Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶ added in v0.0.3
Errorf makes a TracedError with a formatted error.
func Trace ¶
Trace makes a TracedError whose original error is |base|.
When |base| is already a TracedError, it will be returned directly.
func TraceError ¶
TraceError wraps |err| to TracedError when it is not nil.
When |base| is already a TracedError, it will be returned directly.
Example:
resp, err := terr.TraceError(http.Get("https://example.com"))
Types ¶
type FrameLite ¶
type FrameLite struct {
// PC is the program counter for the location in this frame.
PC uintptr
// Func is the function name when available.
Func string
// File is the name of source file when available.
File string
// Line is the line number in source file when available.
Line int
}
FrameLite is a lite version of runtime.Frame.
type TracedError ¶
type TracedError struct {
// contains filtered or unexported fields
}
TracedError represent an error with calling stack.
func (*TracedError) Error ¶
func (e *TracedError) Error() string
Error returns error message with calling stack.
func (*TracedError) Stack ¶
func (e *TracedError) Stack() iter.Seq[FrameLite]
Stack returns calling stack.
func (*TracedError) Unwrap ¶
func (e *TracedError) Unwrap() error
Unwrap returns the original error.
Click to show internal directories.
Click to hide internal directories.