awl/pkg/util/errors.go
Sam Therapy 4ae8471580
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
fix(errors): put exported errors in util
IMO it is better to centralize them

Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-12-06 20:46:04 +01:00

20 lines
377 B
Go

package util
import (
"errors"
"fmt"
)
// ErrHTTPStatus is returned when DoH returns a bad status code.
type ErrHTTPStatus struct {
// Status code
Code int
}
func (e *ErrHTTPStatus) Error() string {
return fmt.Sprintf("doh server responded with HTTP %d", e.Code)
}
// ErrNotError is an error that is not actually an error.
var ErrNotError = errors.New("not an error")