go-errhttp/lengthrequired.go

47 lines
773 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
import (
"errors"
)
var ErrLengthRequired error = LengthRequiredWrap(errors.New("Length Required"))
2017-02-06 20:58:13 +00:00
type LengthRequired interface {
ClientError
LengthRequired()
}
type internalLengthRequired struct {
err error
}
func LengthRequiredWrap(err error) error {
return internalLengthRequired{
err:err,
}
}
func (receiver internalLengthRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalLengthRequired) Err() error {
return receiver.err
}
func (internalLengthRequired) ErrHTTP() {
// Nothing here.
}
2017-02-06 20:58:13 +00:00
func (internalLengthRequired) ClientError() {
// Nothing here.
}
func (internalLengthRequired) LengthRequired() {
// Nothing here.
}
func (receiver internalLengthRequired) Unwrap() error {
return receiver.err
}