2017-02-06 20:58:13 +00:00
|
|
|
package errhttp
|
|
|
|
|
2023-02-16 19:36:53 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrFailedDependency error = FailedDependencyWrap(errors.New("Failed Dependency"))
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
type FailedDependency interface {
|
|
|
|
ClientError
|
|
|
|
FailedDependency()
|
|
|
|
}
|
|
|
|
|
|
|
|
type internalFailedDependency struct {
|
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
func FailedDependencyWrap(err error) error {
|
|
|
|
return internalFailedDependency{
|
|
|
|
err:err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalFailedDependency) Error() string {
|
|
|
|
return receiver.err.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalFailedDependency) Err() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalFailedDependency) ClientError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalFailedDependency) FailedDependency() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
2023-02-16 06:24:28 +00:00
|
|
|
func (receiver internalFailedDependency) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|