Skip to content

Commit

Permalink
Parse: use more idiomatic error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Jul 23, 2024
1 parent 8541bdf commit 89b7b4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ type (

var (
// ErrInvalidQuery error when an invalid query string is passed.
ErrInvalidQuery = errors.New("parse.invalid-query")
ErrInvalidQuery = errors.New("parse middleware: could not parse query")

// ErrInvalidJSONBody error when an empty or malformed JSON body is sent.
ErrInvalidJSONBody = errors.New("parse.json-invalid-body")
ErrInvalidJSONBody = errors.New("parse middleware: could not JSON unmarshal body")

// ErrInvalidContentForType error when e.g. a multipart form is not actually multipart, or empty.
ErrInvalidContentForType = errors.New("parse.invalid-content-for-type")
ErrInvalidContentForType = errors.New("parse middleware: could not parse form")

// ErrErrorInRequestBody error when e.g. a incoming request is not received properly.
ErrErrorInRequestBody = errors.New("parse.error-in-request-body")
ErrErrorInRequestBody = errors.New("parse middleware: could not read body")
)

// Request represents a http request received by the server.
Expand Down

0 comments on commit 89b7b4d

Please sign in to comment.