secondary

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineErrors added in v1.1.1

func CombineErrors(err error, otherErr error) error

CombineErrors returns err, or, if err is nil, otherErr. if err is non-nil, otherErr is attached as secondary error. See the documentation of `WithSecondaryError()` for details.

func WithSecondaryError

func WithSecondaryError(err error, additionalErr error) error

WithSecondaryError enhances the error given as first argument with an annotation that carries the error given as second argument. The second error does not participate in cause analysis (Is, etc) and is only revealed when printing out the error or collecting safe (PII-free) details for reporting.

If additionalErr is nil, the first error is returned as-is.

Tip: consider using CombineErrors() below in the general case.

Detail is shown: - via `errors.GetSafeDetails()`, shows details from secondary error. - when formatting with `%+v`. - in Sentry reports.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL