Skip to content
/ wrapperr Public

Where did that error happen down the call chain? Right at the bottom!

License

Notifications You must be signed in to change notification settings

dc0d/wrapperr

Repository files navigation

PkgGoDev Go Report Card Maintainability Test Coverage

wrapperr

Where did that error happen down the call chain?

Right at the bottom!

https://github.com/dc0d/wrapperr

All you need to do is, instead of:

return nil, err

Do:

return nil, wrapperr.WithStack(err)

Also, it is possible to annotate the stack in the middle:

https://github.com/dc0d/wrapperr

And to get the original error, just used the standard errors.Unwrap(error) function from built-in errors package.