wrapperr

所属分类:数值算法/人工智能
开发工具:GO
文件大小:410KB
下载次数:0
上传日期:2021-08-31 21:33:00
上 传 者sh-1993
说明:  wrapper,那个错误是在呼叫链的哪里发生的?就在底部!
(Where did that error happen down the call chain? Right at the bottom! ,)

文件列表:
.golangci.yml (2908, 2021-09-01)
LICENSE (1073, 2021-09-01)
Makefile (366, 2021-09-01)
annotation.go (331, 2021-09-01)
annotation_test.go (1302, 2021-09-01)
caller-fixtures_test.go (291, 2021-09-01)
caller.go (524, 2021-09-01)
caller_test.go (638, 2021-09-01)
example_1_test.go (639, 2021-09-01)
example_2_test.go (752, 2021-09-01)
example_3_test.go (799, 2021-09-01)
examples_test.go (1200, 2021-09-01)
go.mod (244, 2021-09-01)
go.sum (1615, 2021-09-01)
images (0, 2021-09-01)
images\github_com_dc0d_wrapperr.png (232137, 2021-09-01)
images\github_com_dc0d_wrapperr_annotate.png (240470, 2021-09-01)
loc.go (295, 2021-09-01)
loc_test.go (712, 2021-09-01)
stack.go (3183, 2021-09-01)
stack_fixtures2_test.go (861, 2021-09-01)
stack_fixtures_test.go (873, 2021-09-01)
stack_test.go (6386, 2021-09-01)
test-watch.sh (85, 2021-09-01)
wrapperr.go (132, 2021-09-01)
wrapperr_test.go (223, 2021-09-01)

[![PkgGoDev](https://pkg.go.dev/badge/dc0d/wrapperr)](https://pkg.go.dev/github.com/dc0d/wrapperr) [![Go Report Card](https://goreportcard.com/badge/github.com/dc0d/wrapperr)](https://goreportcard.com/report/github.com/dc0d/wrapperr) [![Maintainability](https://api.codeclimate.com/v1/badges/c0fdd128cafcb6ce0c52/maintainability)](https://codeclimate.com/github/dc0d/wrapperr/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/c0fdd128cafcb6ce0c52/test_coverage)](https://codeclimate.com/github/dc0d/wrapperr/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: ```go return nil, err ``` Do: ```go 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.

近期下载者

相关文件


收藏者