Ecosyste.ms: Packages

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

Top 9.1% on proxy.golang.org
Top 1.3% dependent packages on proxy.golang.org
Top 1.9% dependent repos on proxy.golang.org

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

Package errors contains additional functions, interfaces and structs for recording stack frames, applying basic formatting, working with goroutines, multiple errors and custom error types. It is inspired by package golang.org/x/xerrors and is designed to be a drop-in replacement for it, as well as the standard library's errors package. The errors.New and errors.Errorf functions create errors whose content is a text message and whom can trace stack frames. errors.Wrap and errors.Wrapf create errors by wrapping an existing error with a similar error like errors.New and errors.Errorf. Instead of defining error messages as global variables, it is possible to define them as constants using errors.Msg. This same can be done with errors.Kind: Wrap an existing error with errors.WithFormatter to upgrade the error to include basic formatting. Formatting is done using xerrors.FormatError and thus the same verbs are supported. Any error created with this package implements the fmt.Formatter and xerrors.Formatter interfaces. Every error can track stack trace information. Just wrap it with errors.WithStack and a complete stack trace is captured. An errors.StackTrace can be retrieved using errors.GetStackTrace. Printing the error results in a trace similar to: Stack tracing comes with a performance cost. For production environments this cost can be undesirable. To disable stack tracing, compile your Go program with the "notrace" tag. A convenient function is available to catch panics and store them as an error. Unwrap, Is, As are backwards compatible with the standard library's errors package and act the same.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/go-pogo/errors
Keywords: error, error-stack, frame, go, golang, multi, stacktrace, sync, trace, waitgroup
License: BSD-3-Clause
Latest release: about 1 year ago
First release: over 3 years ago
Namespace: github.com/go-pogo
Dependent packages: 16
Dependent repositories: 8
Stars: 3 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 12 days ago

    Loading...
    Readme
    Loading...