go-errhttp/loopdetected.go

39 lines
630 B
Go
Raw Normal View History

2017-02-06 21:14:15 +00:00
package errhttp
type LoopDetected interface {
ServerError
LoopDetected()
}
var _ LoopDetected = internalLoopDetected{}
2017-02-06 21:14:15 +00:00
type internalLoopDetected struct {
err error
}
func LoopDetectedWrap(err error) error {
return internalLoopDetected{
err:err,
}
}
func (receiver internalLoopDetected) Error() string {
return receiver.err.Error()
}
func (receiver internalLoopDetected) Err() error {
return receiver.err
}
func (internalLoopDetected) ServerError() {
// Nothing here.
}
func (internalLoopDetected) LoopDetected() {
// Nothing here.
}
func (receiver internalLoopDetected) Unwrap() error {
return receiver.err
}