2017-02-06 20:58:13 +00:00
|
|
|
package errhttp
|
|
|
|
|
2023-02-16 19:36:53 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2023-02-16 20:01:00 +00:00
|
|
|
func (internalConflict) ErrHTTP() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
2017-02-06 20:58:13 +00:00
|
|
|
func (internalConflict) ClientError() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (internalConflict) Conflict() {
|
|
|
|
// Nothing here.
|
|
|
|
}
|
2023-02-16 06:24:28 +00:00
|
|
|
|
|
|
|
func (receiver internalConflict) Unwrap() error {
|
|
|
|
return receiver.err
|
|
|
|
}
|