Skip to content

Commit

Permalink
Merge pull request #13 from LUSHDigital/fix/add-bad-request-generator
Browse files Browse the repository at this point in the history
fix: add missing error generator
  • Loading branch information
oliverpauffley authored Sep 17, 2020
2 parents 5fa4990 + 25c2efd commit 16575aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lusherr/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ func (e NotAllowedError) Pin(frame runtime.Frame) error {
return e
}

// NewBadRequestError builds an error for when a client send a bad request.
// e.g. a client sends a request that is missing a required field.
func NewBadRequestError(inner error) error {
return BadRequestError{
frame: frame(1),
inner: inner,
}
}
// BadRequestError indicates that the server cannot or will not
// process the request due to something that is perceived to be a client error.
type BadRequestError struct {
Expand Down

0 comments on commit 16575aa

Please sign in to comment.