errors: Added 405 Method Not Allowed helper function
This commit is contained in:
parent
3732dc2f42
commit
395d70cf01
@ -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.
|
||||
func InternalServerError(id, format string, a ...interface{}) error {
|
||||
return &Error{
|
||||
|
Loading…
x
Reference in New Issue
Block a user