go-errhttp/gatewaytimeout.go

45 lines
759 B
Go
Raw Normal View History

2017-02-06 21:14:15 +00:00
package errhttp
import (
"errors"
)
var ErrGatewayTimeout error = GatewayTimeoutWrap(errors.New("Gateway Timeout"))
2017-02-06 21:14:15 +00:00
type GatewayTimeout interface {
ServerError
GatewayTimeout()
}
var _ GatewayTimeout = internalGatewayTimeout{}
2017-02-06 21:14:15 +00:00
type internalGatewayTimeout struct {
err error
}
func GatewayTimeoutWrap(err error) error {
return internalGatewayTimeout{
err:err,
}
}
func (receiver internalGatewayTimeout) Error() string {
return receiver.err.Error()
}
func (receiver internalGatewayTimeout) Err() error {
return receiver.err
}
func (internalGatewayTimeout) ServerError() {
// Nothing here.
}
func (internalGatewayTimeout) GatewayTimeout() {
// Nothing here.
}
func (receiver internalGatewayTimeout) Unwrap() error {
return receiver.err
}