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

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/phayes/errors

Package errors provides better error handling. Go's standard `errors` package is a simple error package for handling errors, and works fine for shallow codebases, but has several shortcomings that `phayes/errors` hopes to remediate. The biggest anti-pattern that the standard errors package encourages is one we are all familiar with: This anti-pattern is corrected in phayes/errors by allowing you to cleanly wrap one error with another like so: This allows us to cleanly add more details to an error, while preseving the underlying error for later inspection. It also plays nicely with standard library errors and predefined errors: At it's most basic, `phayes/errors` is a drop in replacement for the standard error package. However, it also provides the ability to wrap an error to give it more context: Use the `IsA` function to check to if the error, or any of it's inner errors, is what you're after. This is fully compatible with errors that are not part of phayes/errors. For example:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/phayes/errors
License: BSD-3-Clause
Latest release: almost 8 years ago
First release: almost 8 years ago
Namespace: github.com/phayes
Stars: 6 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 22 days ago

    Loading...
    Readme
    Loading...