stackerror

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(err error) error

Types

type Frame

type Frame struct {
	Filename string
	Method   string
	Line     int
}

func (Frame) String

func (f Frame) String() string

type Stack

type Stack []Frame

Stack represents a stacktrace as a slice of Frames.

func StackTrace

func StackTrace(skip int) Stack

func (Stack) String

func (s Stack) String() string

type StackError

type StackError struct {
	Err   error
	Stack Stack
}
Example
package main

import (
	"errors"
	"fmt"

	"github.com/bikbah/stackerror"
)

func main() {
	e := errors.New("test error")

	es := stackerror.New(e)
	fmt.Println(es)
}
Output:

func (StackError) Error

func (se StackError) Error() string

func (*StackError) Unwrap

func (se *StackError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL