Ecosyste.ms: Packages

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

Top 1.5% on proxy.golang.org
Top 0.3% dependent packages on proxy.golang.org
Top 0.3% dependent repos on proxy.golang.org
Top 4.3% forks on proxy.golang.org
Top 0.4% docker downloads on proxy.golang.org

proxy.golang.org : github.com/joomcode/errorx

Package errorx provides error implementation and error-related utilities. Conventional approach towards errors in Go is quite limited. The typical case implies an error being created at some point: Then being passed along with a no-brainer: And, finally, handled by printing it to the log file: This approach is simple, but quite often it is not enough. There is a need to add context information to error, to check or hide its properties. If all else fails, it pays to have a stack trace printed along with error text. The code above could be modified in this fashion: Here errorx.Decorate is used to add more information, and syntax like errorx.IsOfType can still be used to check the original error. This error also holds a stack trace captured at the point of creation. With errorx syntax, any of this may be customized: stack trace can be omitted, error type can be hidden. Type can be further customized with Traits, and error with Properties. Package provides utility functions to compose, switch over, check, and ignore errors based on their types and properties. See documentation for Error, Type and Namespace for more details.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/joomcode/errorx
Keywords: error-handling, errors, go, stack-traces
License: MIT
Latest release: 11 months ago
First release: over 5 years ago
Namespace: github.com/joomcode
Dependent packages: 207
Dependent repositories: 474
Stars: 958 on GitHub
Forks: 28 on GitHub
Docker dependents: 41
Docker downloads: 16,615,887
See more repository details: repos.ecosyste.ms
Last synced: about 12 hours ago

    Loading...
    Readme
    Loading...