package
0.5.0
Repository: https://github.com/southernlabs-io/go-fw.git
Documentation: pkg.go.dev

# Functions

AsCode returns true if the error, or any wrapped error, is of type Error and has the given code.
IsCode returns true if the error, or any wrapped error, is of type Error and has the given code.
Newf creates a new error with the given code and message format/args.
NewUnknownf creates a new error with the ErrCodeUnknown code and the given message format/args.
SetDefaultCodeKey sets the default key used to represent the error code in the JSON and slog.Value representations of the error.
SetDefaultMessageKey sets the default key used to represent the error message in the JSON and slog.Value representations of the error.
SetDefaultStackKey sets the default key used to represent the error stacktrace in the JSON and slog.Value representations of the error.
UnwrapMulti returns all the errors that have been directly wrapped by err, if any.

# Constants

ErrCodeBadArgument is used when an argument is invalid.
ErrCodeBadState is used when the application is in a state that is not expected, this can be used when the configuration is invalid.
ErrCodeConflict is used when there is a conflict with the current state.
ErrCodeNotAllowed is used when the caller is not allowed to perform the action.
ErrCodeNotAuthenticated is used when the caller is not authenticated.
ErrCodeNotFound is used when a resource is not found.
ErrCodePanic is used when a panic is caught, the original panic error will be wrapped in the new error.
ErrCodeUnknown is used when an error occurs that is not known.
ErrCodeValidationFailed is used when a validation error occurs.

# Variables

As is a copy of the errors.As function from the go std core.
ErrUnsupported is a copy of the errors.ErrUnsupported variable from the go std core.
Is is a copy of the errors.Is function from the go std core.
Join is a copy of the errors.Join function from the go std core.
Unwrap is a copy of the errors.Unwrap function from the go std core.

# Structs

Error is this framework's error type.