go-errhttp/badgateway.go

48 lines
762 B
Go
Raw Normal View History

2017-02-06 21:14:15 +00:00
package errhttp
import (
"errors"
)
var _ Error = internalBadGateway{}
var _ BadGateway = internalBadGateway{}
var ErrBadGateway error = BadGatewayWrap(errors.New("Bad Gateway"))
2017-02-06 21:14:15 +00:00
type BadGateway interface {
ServerError
BadGateway()
}
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 (internalBadGateway) ErrHTTP() {
// Nothing here.
}
2017-02-06 21:14:15 +00:00
func (internalBadGateway) ServerError() {
// Nothing here.
}
func (internalBadGateway) BadGateway() {
// Nothing here.
}
func (receiver internalBadGateway) Unwrap() error {
return receiver.err
}