Documentation ¶
Index ¶
- func As(err error, target any) bool
- func GetBase(err error) error
- func GetStackTrace() []string
- func Is(err, target error) bool
- func Tag(tag string, base HasCode) error
- func TagAndCode(tag string, code codes.Code, base error) error
- type ErrParameterRequired
- type ErrRequiresSuperUser
- type ErrTesting
- type HasCode
- type Tracer
- type TracerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStackTrace ¶
func GetStackTrace() []string
GetStackTrace retrieves the full stack (minus any runtime related functions) from where the Error was instantiated
Types ¶
type ErrParameterRequired ¶ added in v2.23.1
type ErrParameterRequired string
ErrParameterRequired is returned when a required parameter is empty or nil but requires a value.
func (ErrParameterRequired) Error ¶ added in v2.23.1
func (e ErrParameterRequired) Error() string
func (ErrParameterRequired) GetCode ¶ added in v2.23.1
func (e ErrParameterRequired) GetCode() codes.Code
type ErrRequiresSuperUser ¶ added in v2.23.1
type ErrRequiresSuperUser string
ErrRequiresSuperUser is returned when a user attempts to perform an action that requires superuser privileges.
func (ErrRequiresSuperUser) Error ¶ added in v2.23.1
func (e ErrRequiresSuperUser) Error() string
func (ErrRequiresSuperUser) GetCode ¶ added in v2.23.1
func (e ErrRequiresSuperUser) GetCode() codes.Code
func (ErrRequiresSuperUser) Trace ¶ added in v2.23.1
func (e ErrRequiresSuperUser) Trace() string
type ErrTesting ¶ added in v2.23.1
type ErrTesting string
ErrTesting is for use in error test cases only. Should primarily be used for returning generic errors from mocks and ensuring the error is expected
func (ErrTesting) Error ¶ added in v2.23.1
func (e ErrTesting) Error() string
func (ErrTesting) GetCode ¶ added in v2.23.1
func (e ErrTesting) GetCode() codes.Code
type HasCode ¶ added in v2.23.1
HasCode exposes functionality for switching from an error to a status error
type Tracer ¶
type Tracer interface { // Trace returns the long format stack trace from where the error was instantiated Trace() []string }
Tracer provides a stack trace
type TracerError ¶
TracerError is an amalgamation of the Tracer and error interfaces
func New ¶
func New(format string, args ...interface{}) TracerError
New instantiates a TracerError with a stack trace