go-errhttp/unprocessableentity.go

37 lines
662 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
type UnprocessableEntity interface {
ClientError
UnprocessableEntity()
}
type internalUnprocessableEntity struct {
err error
}
func UnprocessableEntityWrap(err error) error {
return internalUnprocessableEntity{
err:err,
}
}
func (receiver internalUnprocessableEntity) Error() string {
return receiver.err.Error()
}
func (receiver internalUnprocessableEntity) Err() error {
return receiver.err
}
func (internalUnprocessableEntity) ClientError() {
// Nothing here.
}
func (internalUnprocessableEntity) UnprocessableEntity() {
// Nothing here.
}
func (receiver internalUnprocessableEntity) Unwrap() error {
return receiver.err
}