Skip to content

Commit

Permalink
fix: slice range panic (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 authored Apr 4, 2024
1 parent 33357ac commit be5188a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leetcode/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type UnexpectedStatusCode struct {

func (e UnexpectedStatusCode) Error() string {
body := "<empty>"
if len(e.Body) > 0 {
if len(e.Body) > 1024 {
body = e.Body[:1024]
}
return fmt.Sprintf("[%d %s] %s", e.Code, http.StatusText(e.Code), body)
Expand Down

0 comments on commit be5188a

Please sign in to comment.