go-errhttp/conflict.go

42 lines
637 B
Go
Raw Normal View History

2017-02-06 20:58:13 +00:00
package errhttp
var _ Error = internalConflict{}
var _ Conflict = internalConflict{}
var ErrConflict = ConflictWrap(nil)
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 (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
}