github.com/bdlm/errors/v2 (go): 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:
Keywords: error-stacks|errors|exceptions|go|golang|stack-trace