Skip to content
ericuniPublic

About

trace error

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Golang Build Status Coverage Status GoReport Go Reference

usage

import "github.com/ericuni/errorx"

The ericuni/errorx provides an easy way to trace errors without losing the original error context.

The exported New functions are designed to replace the errors.New and fmt.Errorf functions both. The same underlying error is there, but the package also records the location at which the error was created.

A primary use case for this library is to add extra context any time an error is returned from a function.

if err := SomeFunc(); err != nil {
  return err
}

This instead becomes:

if err := SomeFunc(); err != nil {
  return errorx.Trace(err)
}

About

trace error

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages