Documentation ¶
Overview ¶
Package errors implements functions to deal with error handling.
Index ¶
- type Error
- func (self *Error) Cause(err error) *Error
- func (self Error) Error() string
- func (self *Error) Extra(extra map[string]any) *Error
- func (self Error) Format(format fmt.State, verb rune)
- func (self Error) Has(err error) bool
- func (self Error) In(err error) bool
- func (self Error) Is(err error) bool
- func (self Error) MarshalJSON() ([]byte, error)
- func (self Error) MarshalText() ([]byte, error)
- func (self Error) Raise(args ...any) *Error
- func (self Error) SentryReport() *sentry.Event
- func (self *Error) Skip(frames int) *Error
- func (self Error) String() string
- func (self Error) StringReport(all ...bool) string
- func (self *Error) Tags(tags map[string]any) *Error
- func (self *Error) With(message string, args ...any) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents an error with traceback and additional info.
func New ¶
New creates a new Error with a message (can have a format) and sets to optionally capture the stack trace when raised (default is true).
func (Error) Format ¶
Format implements the Formatter interface: - %s: Error message - %v: First error report - %+v: All errors reports - default: Error message
func (Error) MarshalJSON ¶
MarshalJSON implements the JSONMarshaler interface.
func (Error) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (Error) Raise ¶
Raise creates a new Error instance formatting its message if needed and optionally captures its stack trace.
func (Error) SentryReport ¶ added in v0.2.0
func (self Error) SentryReport() *sentry.Event
SentryReport returns a Sentry Event containing all the information about the first error and all errors wrapped within itself (including the types, packages messages, stack traces, extra, tags...).
func (Error) StringReport ¶ added in v0.2.0
StringReport returns a string containing all the information about the first error (including the message, stack trace, extra...) or about all errors wrapped within the Error itself (default is all).