Merge pull request #229 from tudurom/add_conflict_error

errors: Added 409 Conflict helper function
This commit is contained in:
Asim Aslam 2018-02-13 08:33:22 +00:00 committed by GitHub
commit eb7788ce25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,3 +91,13 @@ func InternalServerError(id, format string, a ...interface{}) error {
Status: http.StatusText(500),
}
}
// Conflict generates a 409 error.
func Conflict(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 409,
Detail: fmt.Sprintf(format, a...),
Status: http.StatusText(409),
}
}