Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
handle invalid request error (#3476)
Browse files Browse the repository at this point in the history
* handle invalid request error

* Update pkg/highlight/highlight.go

Co-Authored-By: ijsnow <[email protected]>
  • Loading branch information
ijsnow authored Apr 17, 2019
1 parent 9be8cf9 commit 47323fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ func Code(ctx context.Context, content []byte, filepath string, disableTimeout b
table, err2 := generatePlainTable(code)
return table, true, err2
} else if err != nil {
postTooLarge := strings.HasSuffix(err.Error(), "EOF")
if postTooLarge {
if err == gosyntect.ErrRequestTooLarge {
// Failed to highlight code, e.g. for a text file. We still need to
// generate the table.
table, err2 := generatePlainTable(code)
Expand Down

0 comments on commit 47323fe

Please sign in to comment.