go-errhttp/unprocessableentity.go

47 lines
848 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
import (
"errors"
)
var ErrUnprocessableEntity error = UnprocessableEntityWrap(errors.New("Unprocessable Entity"))
2017-02-06 20:58:13 +00:00
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) ErrHTTP() {
// Nothing here.
}
2017-02-06 20:58:13 +00:00
func (internalUnprocessableEntity) ClientError() {
// Nothing here.
}
func (internalUnprocessableEntity) UnprocessableEntity() {
// Nothing here.
}
func (receiver internalUnprocessableEntity) Unwrap() error {
return receiver.err
}