go-errhttp/conflict.go

47 lines
676 B
Go
Raw Normal View History

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