Documentation
¶
Overview ¶
* @Author: nijineko * @Date: 2025-06-08 12:42:57 * @LastEditTime: 2025-06-12 11:10:17 * @LastEditors: nijineko * @Description: noa errors package * @FilePath: \noa\errors\errors.go
* @Author: nijineko * @Date: 2025-06-10 11:30:17 * @LastEditTime: 2025-06-10 11:54:47 * @LastEditors: nijineko * @Description: error stack frame * @FilePath: \noa\errors\stackFrame.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MAX_STACK_DEPTH = 64
)
Functions ¶
Types ¶
type Error ¶
type Error struct {
Err error // base error
Stack []uintptr // stack trace
// contains filtered or unexported fields
}
Error structure
func New ¶
*
- @description: Create a new error
- @param {string} Text error message
- @param {int} Skip number of stack frames to skip (default is 1)
- @return {*Error} wrapped error
func Wrap ¶
*
- @description: Wrap an error with a stack trace
- @param {error} Err base error
- @param {int} Skip number of stack frames to skip
- @return {*Error} wrapped error with stack trace
func (*Error) StackFormat ¶
*
- @description: Get the stack trace as a formatted string
- @return {string} formatted stack trace
func (*Error) StackFrames ¶
func (e *Error) StackFrames() []StackFrame
*
- @description: Get the stack frames of the error
- @return {[]StackFrame} stack frames
type StackFrame ¶
type StackFrame struct {
PC uintptr // Program Counter
Function string // Function name
File string // File name
Line int // Line number
Entry uintptr // Entry point of the function
PackageName string // Package name
FunctionName string // Function name without package
}
Stack Frame structure
Click to show internal directories.
Click to hide internal directories.