Documentation
¶
Overview ¶
Package errors provides a single package for all error-related stuffs and extends the standard library's errors package.
Index ¶
- func As(err error, target any) bool
- func Errorf(format string, a ...any) error
- func HTTP(status int, err any) error
- func Is(err, target error) bool
- func Join(errs ...error) error
- func New(text string) error
- func ReadChannel(errChan <-chan error) error
- func StatusCode(err error) int
- func Unwrap(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTP ¶
HTTP wraps err with the specified HTTP status code. err may be either an error or a string. Any other type will cause a panic. If err is a nil error, the return value will also be nil.
func ReadChannel ¶
ReadChannel reads errors from an errors channel until is closed, and join them.
func StatusCode ¶
StatusCode returns the HTTP status code embedded in the error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.