You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type acceptable interface{
Acceptable() bool
}
// isAcceptable will be compared against the behaviour of errors
// from `db.Create`. If the behaviour match, Post will respond with
// HTTPStatusUnprocessableEntity instead of panicking.
func isAcceptable(err error) bool {
ae, ok := errors.Cause(err).(acceptable)
return ok && ae.Acceptable()
}
Em... Checking behaviour makes things worse. The origin requirement is that there is two type of validation error types that returned by db.Create.
We need to accept multiple types of errors when posting a resource.
The text was updated successfully, but these errors were encountered: