errtrace

package
v1.101.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errtrace provides a function to automatically trace Go errors. Each error is annotated with the filename, line number, and function name where it was created.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trace

func Trace(err error) error

Trace annotates the error message with the filename, line number, and function name.

Example
package main

import (
	"errors"
	"fmt"

	"github.com/Vonage/gosrvlib/pkg/errtrace"
)

func main() {
	err := errors.New("example error")
	testErr := errtrace.Trace(err)

	fmt.Println(testErr)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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