Documentation
¶
Index ¶
- func NewWithGRPCCode(msg string, grpcCode codes.Code) error
- func SetBaseFilePath(path string)
- func WrapWithGRPCCode(err error, msg string, grpcCode codes.Code) error
- type ErrorExt
- func New(msg string) ErrorExt
- func NewWithSkip(msg string, skip int) ErrorExt
- func NewWithSkipAndStatus(msg string, skip int, status *grpcstatus.Status) ErrorExt
- func NewWithStatus(msg string, status *grpcstatus.Status) ErrorExt
- func Wrap(err error, msg string) ErrorExt
- func WrapWithSkip(err error, msg string, skip int) ErrorExt
- func WrapWithSkipAndStatus(err error, msg string, skip int, status *grpcstatus.Status) ErrorExt
- func WrapWithStatus(err error, msg string, status *grpcstatus.Status) ErrorExt
- type NotifyExt
- type StackFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithGRPCCode ¶
NewWithGRPCCode creates a new error with statck information and GRPC status with the given GRPC code
func SetBaseFilePath ¶
func SetBaseFilePath(path string)
SetBaseFilePath sets the base file path for linking source code with reported stack information
Types ¶
type ErrorExt ¶
type ErrorExt interface {
error
Callers() []uintptr
StackFrame() []StackFrame
//Cause returns the original error object that caused this error
Cause() error
//GRPCStatus allows ErrorExt to be treated as a GRPC Error
GRPCStatus() *grpcstatus.Status
}
ErrorExt is the interface that defines a error, any ErrorExt implementors can use and override errors and notifier package
func NewWithSkip ¶
NewWithSkip creates a new error skipping the number of function on the stack
func NewWithSkipAndStatus ¶
func NewWithSkipAndStatus(msg string, skip int, status *grpcstatus.Status) ErrorExt
NewWithSkipAndStatus creates a new error skipping the number of function on the stack and GRPC status
func NewWithStatus ¶
func NewWithStatus(msg string, status *grpcstatus.Status) ErrorExt
NewWithStatus creates a new error with statck information and GRPC status
func WrapWithSkip ¶
WrapWithSkip wraps an existing error and appends stack information if it does not exists skipping the number of function on the stack
func WrapWithSkipAndStatus ¶
WrapWithSkip wraps an existing error and appends stack information if it does not exists skipping the number of function on the stack along with GRPC status
func WrapWithStatus ¶
func WrapWithStatus(err error, msg string, status *grpcstatus.Status) ErrorExt
Wrap wraps an existing error and appends stack information if it does not exists along with GRPC status
type StackFrame ¶
type StackFrame struct {
File string `json:"file"`
Line int `json:"line"`
Func string `json:"function"`
}
StackFrame represents the stackframe for tracing exception