https://github.com/dc0d/wrapperr
Where did that error happen down the call chain? Right at the bottom!
https://github.com/dc0d/wrapperr
call-stack error-log golang
Last synced: about 1 month ago
JSON representation
Where did that error happen down the call chain? Right at the bottom!
- Host: GitHub
- URL: https://github.com/dc0d/wrapperr
- Owner: dc0d
- License: mit
- Created: 2020-10-02T19:28:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-31T21:33:00.000Z (over 3 years ago)
- Last Synced: 2025-03-26T07:23:10.517Z (about 2 months ago)
- Topics: call-stack, error-log, golang
- Language: Go
- Homepage:
- Size: 443 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/dc0d/wrapperr) [](https://goreportcard.com/report/github.com/dc0d/wrapperr) [](https://codeclimate.com/github/dc0d/wrapperr/maintainability) [](https://codeclimate.com/github/dc0d/wrapperr/test_coverage)
# wrapperr
_Where_ did that error happen down the call chain?
> Right at the bottom!
![]()
All you need to do is, instead of:
```go
return nil, err
```Do:
```go
return nil, wrapperr.WithStack(err)
```Also, it is possible to annotate the stack in the middle:
![]()
And to get the original error, just used the standard `errors.Unwrap(error)` function from built-in `errors` package.