go-errhttp/notacceptable.go

43 lines
774 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
var _ Error = internalNotAcceptable{}
var _ ClientError = internalNotAcceptable{}
var _ NotAcceptable = internalNotAcceptable{}
var ErrNotAcceptable error = NotAcceptableWrap(nil)
2017-02-06 20:58:13 +00:00
type NotAcceptable interface {
ClientError
NotAcceptable()
}
type internalNotAcceptable struct {
err error
}
func NotAcceptableWrap(err error) error {
return internalNotAcceptable{
err:err,
}
}
func (receiver internalNotAcceptable) Error() string {
return receiver.err.Error()
}
func (internalNotAcceptable) ErrHTTP() {
// Nothing here.
}
2017-02-06 20:58:13 +00:00
func (internalNotAcceptable) ClientError() {
// Nothing here.
}
func (internalNotAcceptable) NotAcceptable() {
// Nothing here.
}
func (receiver internalNotAcceptable) Unwrap() error {
return receiver.err
}