go-errhttp/variantalsonegotiates.go

53 lines
1.1 KiB
Go
Raw Normal View History

2017-02-06 21:14:15 +00:00
package errhttp
import (
"net/http"
)
var _ Error = internalVariantAlsoNegotiates{}
var _ ServerError = internalVariantAlsoNegotiates{}
var _ VariantAlsoNegotiates = internalVariantAlsoNegotiates{}
var ErrVariantAlsoNegotiates error = VariantAlsoNegotiatesWrap(nil)
2017-02-06 21:14:15 +00:00
type VariantAlsoNegotiates interface {
ServerError
VariantAlsoNegotiates()
}
var _ VariantAlsoNegotiates = internalVariantAlsoNegotiates{}
2017-02-06 21:14:15 +00:00
type internalVariantAlsoNegotiates struct {
err error
}
func VariantAlsoNegotiatesWrap(err error) error {
return internalVariantAlsoNegotiates{
err:err,
}
}
func (receiver internalVariantAlsoNegotiates) Error() string {
2023-10-01 02:30:28 +00:00
err := receiver.err
if nil == err {
return http.StatusText(receiver.ErrHTTP())
}
return err.Error()
2017-02-06 21:14:15 +00:00
}
func (internalVariantAlsoNegotiates) ErrHTTP() int {
return http.StatusVariantAlsoNegotiates
}
2017-02-06 21:14:15 +00:00
func (internalVariantAlsoNegotiates) ServerError() {
// Nothing here.
}
func (internalVariantAlsoNegotiates) VariantAlsoNegotiates() {
// Nothing here.
}
func (receiver internalVariantAlsoNegotiates) Unwrap() error {
return receiver.err
}