Top 2.8% dependent packages on proxy.golang.org
Top 2.5% dependent repos on proxy.golang.org
Top 8.8% forks on proxy.golang.org
proxy.golang.org : github.com/bdlm/errors/v2
Package errors provides simple, concise, useful error handling and annotation. This package aims to implement the Error Inspection and Error Values Go2 draft designs. https://go.googlesource.com/proposal/+/master/design/go2draft-error-inspection.md https://go.googlesource.com/proposal/+/master/design/go2draft.md One of the biggest frustrations with Go error handling is the lack of forensic and meta information errors should provide. By default errors are just a string and possibly a type. They can't tell you where they occurred or the path through the call stack they followed. The error implementation in Go is robust enough to control program flow but it's not very efficient for troubleshooting or analysis. Since the idom in Go is that we pass the error back up the stack anyway: it's trivial to make errors much more informative with a simple error package. `bdlm/errors` makes this easy and supports tracing the call stack and the error callers with relative ease. Custom error types are also fully compatible with this package and can be used freely. Install All package methods work with any `error` type as well as `nil` values, and error instances implement the Unwrap, Is, Marshaler, and Formatter interfaces as well as the github.com/bdlm/std/errors interfaces. Create an error: Create an error using formatting verbs: Wrap an error: Wrap an error with another error: Get the previous error, if any: Test for a specific error type: Test to see if a specific error type exists anywhere in an error stack: Iterate through an error stack:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/bdlm/errors/v2
Keywords:
error-stacks
, errors
, exceptions
, go
, golang
, stack-trace
License: MIT
Latest release: over 4 years ago
First release: over 5 years ago
Namespace: github.com/bdlm/errors
Dependent packages: 4
Dependent repositories: 4
Stars: 6 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 19 days ago