Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InternalServerError = NewHTTPError(http.StatusInternalServerError, "internal server error")
Functions ¶
func ErrorWithStack ¶
func HTTPStatus ¶
func RecoverTo ¶
func RecoverTo(err *error)
Encapsulates the pattern of writing to a named err result value if recovered. Usage: `defer errutil.RecoverTo(&err)`.
func Recovering ¶
Invokes f, recovering from any panics.
func ToTracedError ¶
Like ToError, but wraps non-nil errors as a TracedError.
Types ¶
type HTTPError ¶
TODO: Stop abusing this for internal vs external errors.
func NewHTTPError ¶
func WithHTTPStatus ¶
type Panic ¶
type Panic struct {
Value any
}
Implementation of the error interface for any panic value.
type TracedError ¶
type TracedError struct {
// contains filtered or unexported fields
}
Pair a wrapped error with a stack trace.
func NewTracedError ¶
func NewTracedError(err error, stack string) TracedError
func (TracedError) Stack ¶
func (err TracedError) Stack() string
func (TracedError) Unwrap ¶
func (err TracedError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.