go-errhttp/networkauthenticationrequir...

49 lines
1.1 KiB
Go
Raw Normal View History

2017-02-06 21:14:15 +00:00
package errhttp
import (
"errors"
)
var ErrNetworkAuthenticationRequired error = NetworkAuthenticationRequiredWrap(errors.New("Network Authentication Required"))
2017-02-06 21:14:15 +00:00
type NetworkAuthenticationRequired interface {
ServerError
NetworkAuthenticationRequired()
}
var _ NetworkAuthenticationRequired = internalNetworkAuthenticationRequired{}
2017-02-06 21:14:15 +00:00
type internalNetworkAuthenticationRequired struct {
err error
}
func NetworkAuthenticationRequiredWrap(err error) error {
return internalNetworkAuthenticationRequired{
err:err,
}
}
func (receiver internalNetworkAuthenticationRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalNetworkAuthenticationRequired) Err() error {
return receiver.err
}
func (internalNetworkAuthenticationRequired) ErrHTTP() {
// Nothing here.
}
2017-02-06 21:14:15 +00:00
func (internalNetworkAuthenticationRequired) ServerError() {
// Nothing here.
}
func (internalNetworkAuthenticationRequired) NetworkAuthenticationRequired() {
// Nothing here.
}
func (receiver internalNetworkAuthenticationRequired) Unwrap() error {
return receiver.err
}