Package Usage: go: github.com/samsarahq/go/oops
Package oops adds detailed stacktraces to your Go errors.
To use the oops package, calls oops.Errorf when creating a new error, and
oops.Wrapf when returning nested errors. To access the original error, use
oops.Cause. Each function in the callstack can add extra debugging
information to help you track down errors.
An example error (from the program below) looks as follows:
The first time oops.Errorf or oops.Wrapf is called, it captures a
stacktrace. To keep your stacktraces as detailed as possible, it is best to
call oops.Wrapf every time you return an error. If you have no context to
add, you can always pass an empty format string to oops.Wrapf.
When adding oops to an existing package or program, you might have
intermediate functions that don't yet call oops.Wrapf when returning errors.
That is no problem, as later calls to oops.Wrapf will attach their messages
to right stackframe. However, you might as well add oops.Wrapf there as
well!
Usage:
1 version
Latest release: over 3 years ago
5 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/samsarahq/go/oops