go-errhttp/gone.go

42 lines
579 B
Go
Raw Normal View History

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