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

Top 1.5% dependent packages on proxy.golang.org
Top 1.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/gildas/go-errors

This package combines Go standard errors package (https://pkg.go.dev/errors) and github.com/pkg/errors(https://github.com/pkg/errors). All funcs from both packages are available. On top of them, I added some sentinels for common errors I need all the time. All sentinels are from the same type which contains various information. Whenever a sentinel is used, a StackTrace is also generated. Here is how to use the errors: If you plan to do something with the content of the error, you would try that: Note: You should not use "var details errors.Error", use the pointer version "var details *errors.Error" instead. When several `errors.Error` are chained up, this can be used to extract the ones you want: To return an HTTP Status as an error, you could do this: You can also add more than one _cause_ to an `errors.Error`, turning it into a _multi-error_ container: Finally, errors.Error supports JSON serialization.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/gildas/go-errors
Keywords: error-handling , go
License: MIT
Latest release: 6 months ago
First release: over 5 years ago
Namespace: github.com/gildas
Dependent packages: 15
Dependent repositories: 10
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 13 days ago

    Loading...
    Readme
    Loading...