Documentation
¶
Index ¶
- func Append(err error, errChild error, format string, args ...any) error
- func Join(err error, format string, args ...any) error
- func ToSnakeCase(str string) string
- type Action
- type Error
- func Add(err Error, status status.StatusCode, desc string, message any) Error
- func Convert(err error, status status.StatusCode, desc string, message any) Error
- func New(status status.StatusCode, desc string, msg any) Error
- func NewWithDescription(status status.StatusCode, desc string, format string, a ...any) Error
- func Unwrap(err error) (bool, Error)
- type ErrorData
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToSnakeCase ¶ added in v0.12.0
Types ¶
type Action ¶ added in v0.12.0
type Action struct {
Status status.StatusCode `json:"status"`
Description string `json:"description"`
Message any `json:"message"`
}
func (Action) LogValue ¶ added in v0.15.0
LogValue implements slog.LogValuer and returns a grouped value with fields redacted. See https://pkg.go.dev/log/slog#LogValuer
type Error ¶ added in v0.12.0
type Error interface {
error
Action() Action
Src() *Source
Format(*strings.Builder)
LogValue() slog.Value
}
func New ¶ added in v0.12.0
func New(status status.StatusCode, desc string, msg any) Error
creates new error object
func NewWithDescription ¶ added in v0.15.0
creates new error object
type ErrorData ¶ added in v0.12.0
type ErrorData struct {
Time time.Time
ActionData Action `json:"action"`
Source *Source `json:"source,omitempty"`
Child Error `json:"child"`
}
func (ErrorData) LogValue ¶ added in v0.15.0
LogValue implements slog.LogValuer and returns a grouped value with fields redacted. See https://pkg.go.dev/log/slog#LogValuer
Click to show internal directories.
Click to hide internal directories.