An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/agext/errors

Package errors provides extended error handling. When you need to retain more information about an error message than a single string allows, just substitute this package for the one in the standard library. The `New` function still accepts a single string as argument, so no code will be broken. Where you need to include additional information, you can provide it to `New` in a `Desc` structure instead of the string, or you can add it to the error message using one of its setter methods. The additional information can be used for smarter error handling and logging: - `Level` differentiates between warnings, regular errors, panics converted to errors, and fatal errors; - `Code` allows custom classification and prioritizing, by using ranges or bit-level masks; - `Info` offers a store for arbitrary data and messages, besides the main error `Text`; the special string "debug.stack", if present as an element in the Info slice, is automatically replaced by a stack trace at the point the error message has been created.

Ecosystem
proxy.golang.org
Latest Release
v1.0.1
about 9 years ago
Versions
1
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/agext/errors
spec
License Apache-2.0
Namespace github.com/agext
First Release about 9 years ago
Last Synced 21 days ago
Repository
Stars 1 on GitHub
Forks 0 on GitHub
Rankings on proxy.golang.org
Overall Top 8.2%