errors
clear go error wrapping with caller (by go-faster)
multierr
Combine one or more Go errors together (by uber-go)
errors | multierr | |
---|---|---|
1 | 4 | |
34 | 925 | |
- | 2.6% | |
4.4 | 3.9 | |
5 months ago | 22 days ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
errors
Posts with mentions or reviews of errors.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-02-01.
multierr
Posts with mentions or reviews of multierr.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-11-29.
-
Multiple error wrapping is coming in Go 1.20
The only remaining use-case I see here looks like https://github.com/uber-go/multierr , maybe useful in concurrent scenarios. But on my side this is rather anecdotical, and anyway already addressed by a well documented and tested third party.
- mdobak/go-xerrors: Yet another error handling library.
- Better error handling in Golang: Theory and practical tips
-
Return multiple dependent errors in Go?
There are a few libraries that solve this problem. One is https://github.com/uber-go/multierr , another https://github.com/hashicorp/go-multierror . They have similar APIs and are pretty easy to use. If you don't want to import another library, it's pretty easy to do something similar yourself, inspired by them. 😊
What are some alternatives?
When comparing errors and multierr you can also consider the following projects:
eris - Error handling library with readable stack traces and flexible formatting support 🎆
go-multierror - A Go (golang) package for representing a list of errors as a single error.
errors - Go error library with error portability over the network
go-xerrors - The go-xerrors is an idiomatic and lightweight package that provides a set of functions to make working with errors easier.
tracerr - Golang errors with stack trace and source fragments.
errors - Simple error handling primitives