2017-02-06 20:58:13 +00:00
|
|
|
package errhttp
|
|
|
|
|
2023-02-16 19:36:53 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrRequestTimeout error = RequestTimeoutWrap(errors.New("Request Timeout"))
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
type RequestTimeout interface {
|
|
|
|
error
|
|
|
|
Err() error
|
|
|
|
RequestTimeout()
|
|
|
|
}
|
|
|
|
|
|
|
|
type internalRequestTimeout struct {
|
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
func RequestTimeoutWrap(err error) error {
|
|
|
|
return internalRequestTimeout{
|
|
|
|
err:err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalRequestTimeout) Error() string {
|
|
|
|
return receiver.err.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalRequestTimeout) Err() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|
|
|
|
|
2023-02-16 20:01:00 +00:00
|
|
|
func (internalRequestTimeout) ErrHTTP() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
func (internalRequestTimeout) ClientError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalRequestTimeout) RequestTimeout() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
2023-02-16 06:24:28 +00:00
|
|
|
|
|
|
|
func (receiver internalRequestTimeout) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|