# `gno.land/p/nym-moultest123/errs` Combine several errors into one. A port of the core of [uber-go/multierr](https://github.com/uber-go/multierr) (MIT), trimmed to what gno needs. ```go func Combine(errs ...error) error // nil, the single error, or a *multiError func Errors(err error) []error // unwrap back to the flat list ``` `Combine` has three behaviours worth knowing, because they are what make it safe to call unconditionally: - all inputs nil gives `nil`, so `if err := errs.Combine(...); err != nil` works as written; - exactly one non-nil input is returned **as itself**, not wrapped, so a type assertion or `errors.Is` upstream still matches; - nested `*multiError` inputs are flattened, so combining in a loop does not build a tree. The combined error prints two ways: `Error()` gives one line with `; ` between messages (for logs and panics), `String()` gives one error per line (for a Render block). ```go err1 := doSomething() err2 := doSomethingElse() if err := errs.Combine(err1, err2); err != nil { return err } ``` --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).