go-errhttp/upgraderequired.go

37 lines
618 B
Go
Raw Normal View History

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