Documentation
¶
Index ¶
- Constants
- func Errno(err error) int
- func New(text string, args ...interface{}) error
- func Throw(err error) error
- func Throwf(format string, args ...interface{}) error
- func Try(fn func() error) (err error)
- func WithErrno(code int, err error) error
- func WithErrnof(code int, format string, args ...interface{}) error
- type Errors
Constants ¶
View Source
const ( EUnknown = -1 EOK = 0 )
Variables ¶
This section is empty.
Functions ¶
func Errno ¶
Errno finds the first error in err's chain that contains errno.
The chain consists of err itself followed by the sequence of errors obtained by repeatedly calling Unwrap.
func Throwf ¶
Throwf returns an error that formats as the given text with source code position information.
func Try ¶
Try executes the fn, and then recovers any panics as an error. If no panics, return the result of fn.
func WithErrnof ¶
WithErrnof returns an error that formats as the given text with code.
Types ¶
Click to show internal directories.
Click to hide internal directories.