Merge pull request #305 from ahmadnurus/add_method_not_allowed_error
errors: Added 405 Method Not Allowed helper function
This commit is contained in:
commit
52a4beb072
@ -82,6 +82,16 @@ func NotFound(id, format string, a ...interface{}) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MethodNotAllowed generates a 405 error.
|
||||||
|
func MethodNotAllowed(id, format string, a ...interface{}) error {
|
||||||
|
return &Error{
|
||||||
|
Id: id,
|
||||||
|
Code: 405,
|
||||||
|
Detail: fmt.Sprintf(format, a...),
|
||||||
|
Status: http.StatusText(405),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// InternalServerError generates a 500 error.
|
// InternalServerError generates a 500 error.
|
||||||
func InternalServerError(id, format string, a ...interface{}) error {
|
func InternalServerError(id, format string, a ...interface{}) error {
|
||||||
return &Error{
|
return &Error{
|
||||||
|
Loading…
Reference in New Issue
Block a user