Documentation
¶
Index ¶
- func As(err error, target any) bool
- func GetBase(err error) error
- func GetStackTrace() []string
- func Is(err, target error) bool
- type ErrInvalidArgument
- type ErrNotFound
- type ErrNotImplemented
- type ErrParameterRequired
- type ErrRequiresSuperUser
- type ErrTesting
- type HasCode
- type TaggedError
- 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 ErrInvalidArgument ¶ added in v2.24.2
type ErrInvalidArgument string
ErrInvalidArgument value for the expected functionality.
func (ErrInvalidArgument) Error ¶ added in v2.24.2
func (e ErrInvalidArgument) Error() string
func (ErrInvalidArgument) GRPCStatus ¶ added in v2.26.2
func (e ErrInvalidArgument) GRPCStatus() *status.Status
func (ErrInvalidArgument) GetCode ¶ added in v2.24.2
func (e ErrInvalidArgument) GetCode() codes.Code
type ErrNotFound ¶ added in v2.24.2
type ErrNotFound string
ErrNotFound is returned when a resource does not exist for a given identifier.
func (ErrNotFound) Error ¶ added in v2.24.2
func (e ErrNotFound) Error() string
func (ErrNotFound) GRPCStatus ¶ added in v2.26.2
func (e ErrNotFound) GRPCStatus() *status.Status
func (ErrNotFound) GetCode ¶ added in v2.24.2
func (e ErrNotFound) GetCode() codes.Code
type ErrNotImplemented ¶ added in v2.27.0
type ErrNotImplemented string
ErrNotImplemented for a feature that is not implemented.
func (ErrNotImplemented) Error ¶ added in v2.27.0
func (e ErrNotImplemented) Error() string
func (ErrNotImplemented) GRPCStatus ¶ added in v2.27.0
func (e ErrNotImplemented) GRPCStatus() *status.Status
func (ErrNotImplemented) GetCode ¶ added in v2.27.0
func (e ErrNotImplemented) GetCode() codes.Code
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) GRPCStatus ¶ added in v2.26.2
func (e ErrParameterRequired) GRPCStatus() *status.Status
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) GRPCStatus ¶ added in v2.26.2
func (e ErrRequiresSuperUser) GRPCStatus() *status.Status
func (ErrRequiresSuperUser) GetCode ¶ added in v2.23.1
func (e ErrRequiresSuperUser) GetCode() codes.Code
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) GRPCStatus ¶ added in v2.26.2
func (e ErrTesting) GRPCStatus() *status.Status
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 TaggedError ¶ added in v2.24.1
type TaggedError interface {
error
// GetGRPCStatus returns the status.Status for this error
GRPCStatus() *status.Status
}
TaggedError is an error that has been tagged with a status.Status
func TagAndCode ¶ added in v2.23.1
func TagAndCode(tag string, code codes.Code, base error) TaggedError
TagAndCode the passed 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(message string) TracerError
New instantiates a TracerError with a message and a stack trace
func Newf ¶ added in v2.24.0
func Newf(format string, args ...interface{}) TracerError
Newf instantiates a TracerError with a formatted message and a stack trace