2017-02-06 20:58:13 +00:00
|
|
|
package errhttp
|
|
|
|
|
2023-02-16 19:36:53 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrMethodNotAllowed error = MethodNotAllowedWrap(errors.New("Method Not Allowed"))
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
type MethodNotAllowed interface {
|
|
|
|
ClientError
|
|
|
|
MethodNotAllowed()
|
|
|
|
}
|
|
|
|
|
|
|
|
type internalMethodNotAllowed struct {
|
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
func MethodNotAllowedWrap(err error) error {
|
|
|
|
return internalMethodNotAllowed{
|
|
|
|
err:err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalMethodNotAllowed) Error() string {
|
|
|
|
return receiver.err.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver internalMethodNotAllowed) Err() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalMethodNotAllowed) ClientError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalMethodNotAllowed) MethodNotAllowed() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
2023-02-16 06:24:28 +00:00
|
|
|
func (receiver internalMethodNotAllowed) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|