contexttags

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextTags

func GetContextTags(err error) (res []*logtags.Buffer)

GetContextTags retrieves the k/v pairs stored in the error. The sets are returned from outermost to innermost level of cause. The returned logtags.Buffer only know about the string representation of the values originally captured by the error.

func WithContextTags

func WithContextTags(err error, ctx context.Context) error

WithContextTags captures the k/v pairs stored in the context via the `logtags` package and annotates them on the error.

Only the stromg representation of values remains available. This is because the library cannot guarantee that the underlying value is preserved across the network. To avoid creating a stateful interface (where the user code needs to know whether an error has traveled through the network or not), the library restricts access to the value part as strings. See GetContextTags() below.

Detail is shown: - via `errors.GetSafeDetails()`. - via `GetContextTags()` below. - 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