go-errhttp/unprocessableentity.go

42 lines
830 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
var _ Error = internalUnprocessableEntity{}
var _ UnprocessableEntity = internalUnprocessableEntity{}
var ErrUnprocessableEntity error = UnprocessableEntityWrap(nil)
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 (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
}