mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-19 12:07:06 +02:00
update errors.
This commit is contained in:
parent
c77d2b0305
commit
4e6a78fb54
2 changed files with 15 additions and 6 deletions
|
@ -36,11 +36,20 @@ func ErrMessage(HTTPStatusCode int, StatusText string) render.Renderer {
|
|||
}
|
||||
}
|
||||
|
||||
func ErrInvalidRequest(err error) render.Renderer {
|
||||
func ErrBadRequest(err error) render.Renderer {
|
||||
return &ErrResponse{
|
||||
Err: err,
|
||||
HTTPStatusCode: 400,
|
||||
StatusText: "Invalid request.",
|
||||
StatusText: "Bad request.",
|
||||
ErrorText: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
func ErrUnprocessableEntity(err error) render.Renderer {
|
||||
return &ErrResponse{
|
||||
Err: err,
|
||||
HTTPStatusCode: 400,
|
||||
StatusText: "Unprocessable Entity.",
|
||||
ErrorText: err.Error(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue