go-errhttp/toomanyrequests.go

43 lines
812 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
var _ Error = internalTooManyRequests{}
var _ ClientError = internalTooManyRequests{}
var _ TooManyRequests = internalTooManyRequests{}
var ErrTooManyRequests error = TooManyRequestsWrap(nil)
2017-02-06 20:58:13 +00:00
type TooManyRequests interface {
ClientError
TooManyRequests()
}
type internalTooManyRequests struct {
err error
}
func TooManyRequestsWrap(err error) error {
return internalTooManyRequests{
err:err,
}
}
func (receiver internalTooManyRequests) Error() string {
return receiver.err.Error()
}
func (internalTooManyRequests) ErrHTTP() {
// Nothing here.
}
2017-02-06 20:58:13 +00:00
func (internalTooManyRequests) ClientError() {
// Nothing here.
}
func (internalTooManyRequests) TooManyRequests() {
// Nothing here.
}
func (receiver internalTooManyRequests) Unwrap() error {
return receiver.err
}