Documentation
¶
Index ¶
- func ErrorSurface(err error) string
- func GenerateSentryEvent(err error, ws ...sentryWrapper) *sentry.Event
- func GetErrorCodeString(err error) string
- func Is(err error, target error) bool
- func New(code Code, msg string) error
- func Origin(err error) error
- func ReportSentry(err error, ws ...sentryWrapper)
- func ReportSentryWithContext(ctx context.Context, err error, ws ...sentryWrapper)
- func SetStackedErrorJsonFormatter(f StackedErrorJsonFormatter)
- func StackedErrorJson(err error) []any
- func Unwrap(e error) error
- func WithCode(code Code) errWrapper
- func WithData(data CustomData) errWrapper
- func WithMessage(msg string) errWrapper
- func WithSentryContexts(m map[string]sentry.Context) sentryWrapper
- func WithSentryLevel(l sentry.Level) sentryWrapper
- func WithSentryTags(m map[string]string) sentryWrapper
- func Wrap(err error, ws ...errWrapper) error
- type Code
- type CustomData
- type DefaultCode
- type DefaultCustomData
- type Frames
- type StackedErrorJsonFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorSurface ¶
ErrorSurface returns the surface of err.Error()
func GenerateSentryEvent ¶
GenerateSentryEvent is a method to generate a sentry event from an error
func GetErrorCodeString ¶
GetErrorCodeString returns the error code string attached to the error.
func ReportSentry ¶
func ReportSentry(err error, ws ...sentryWrapper)
ReportSentry is a method to report an error to sentry
func ReportSentryWithContext ¶ added in v0.0.2
ReportSentryWithContext is a method to report an error to sentry with a context
func SetStackedErrorJsonFormatter ¶
func SetStackedErrorJsonFormatter(f StackedErrorJsonFormatter)
SetStackedErrorJsonFormatter sets the formatter for StackedErrorJson. change the format of the automatically set error
func StackedErrorJson ¶
StackedErrorJson returns a slice of JSON objects representing the error stack.
func WithCode ¶
func WithCode(code Code) errWrapper
WithCode returns an error wrapper that adds a code to the error.
func WithData ¶
func WithData(data CustomData) errWrapper
WithData returns an error wrapper that adds custom data to the error.
func WithMessage ¶
func WithMessage(msg string) errWrapper
WithMessage returns an error wrapper that adds a message to the error.
func WithSentryContexts ¶
WithSentryContexts is a function to add contexts to a sentry event
func WithSentryLevel ¶
WithSentryLevel is a function to set the level of a sentry event
func WithSentryTags ¶
WithSentryTags is a function to add tags to a sentry event
Types ¶
type Code ¶
type Code interface {
ErrorCode() string
}
Code is an interface that represents an error code.
func GetErrorCode ¶
GetErrorCode returns the error code attached to the error.
type CustomData ¶
type CustomData interface { String() string Clone() CustomData }
CustomData is the interface for custom data attached to the error.
func GetCustomData ¶
func GetCustomData(err error) []CustomData
GetCustomData returns the custom data attached to the error.
type DefaultCode ¶ added in v0.0.2
type DefaultCode string
DefaultCode is a type that represents an error code as a string.
func (DefaultCode) ErrorCode ¶ added in v0.0.2
func (s DefaultCode) ErrorCode() string
type DefaultCustomData ¶
func (DefaultCustomData) Clone ¶
func (d DefaultCustomData) Clone() CustomData
func (DefaultCustomData) String ¶
func (d DefaultCustomData) String() string
type Frames ¶ added in v0.0.2
type Frames []uintptr
A Frames represents a program counter inside a stack frames.