Documentation ¶
Overview ¶
Package eerror stands for Encore Error and is used to provide a little more information about the underlying error's metadata.
It also provides helper methods for working with zerolog's context
Index ¶
- func LogWithMeta(evt *zerolog.Event, err error) *zerolog.Event
- func MetaFrom(err error) map[string]any
- func New(module string, msg string, meta map[string]any) error
- func WithMeta(err error, meta map[string]any) error
- func Wrap(cause error, module string, msg string, meta map[string]any) error
- type Error
- type StackFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogWithMeta ¶
LogWithMeta merges in the metadata from the errors into the log context
func MetaFrom ¶
MetaFrom will return the merged metadata from any eerror.Error objects in the errors given. It will unwrap errors as it descends
Types ¶
type Error ¶
type Error struct { Module string `json:"module"` // The module the error was raised in (normally the package name, but could be a larger "module" name) Message string `json:"message"` // The message of the error, it should be human-readable and should be low entropy (i.e. so multiple errors of the same can be grouped) Meta map[string]any `json:"meta"` // Metadata about the error, this can be high entropy as it isn't used to group errors Stack []*StackFrame `json:"stack"` // The stack trace of the error // contains filtered or unexported fields }
func (*Error) StackTrace ¶
func (e *Error) StackTrace() errors.StackTrace
StackTrace implements the StackTraceProvider interface for some libraries including ZeroLog, xerrors and Sentry
Click to show internal directories.
Click to hide internal directories.