2017-02-06 21:14:15 +00:00
|
|
|
package errhttp
|
|
|
|
|
|
|
|
type BadGateway interface {
|
|
|
|
ServerError
|
|
|
|
BadGateway()
|
|
|
|
}
|
|
|
|
|
2023-02-16 06:24:28 +00:00
|
|
|
var _ BadGateway = internalBadGateway{}
|
|
|
|
|
2017-02-06 21:14:15 +00:00
|
|
|
type internalBadGateway struct {
|
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
func BadGatewayWrap(err error) error {
|
|
|
|
return internalBadGateway{
|
|
|
|
err:err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalBadGateway) Error() string {
|
|
|
|
return receiver.err.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalBadGateway) Err() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalBadGateway) ServerError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalBadGateway) BadGateway() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
2023-02-16 06:24:28 +00:00
|
|
|
|
|
|
|
func (receiver internalBadGateway) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|