2017-02-06 20:58:13 +00:00
|
|
|
package errhttp
|
|
|
|
|
2023-02-16 19:36:53 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrNotFound error = NotFoundWrap(errors.New("Not Found"))
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
type NotFound interface {
|
|
|
|
ClientError
|
|
|
|
NotFound ()
|
|
|
|
}
|
|
|
|
|
|
|
|
type internalNotFound struct {
|
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
func NotFoundWrap(err error) error {
|
|
|
|
return internalNotFound {
|
|
|
|
err:err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalNotFound ) Error() string {
|
|
|
|
return receiver.err.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalNotFound ) Err() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|
|
|
|
|
2023-02-16 20:01:00 +00:00
|
|
|
func (internalNotFound ) ErrHTTP() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
func (internalNotFound ) ClientError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalNotFound ) NotFound() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
2023-02-16 06:24:28 +00:00
|
|
|
|
|
|
|
func (receiver internalNotFound) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|