metaerrors

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package metaerrors provides a way to attach metadata to errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaError

type MetaError struct {
	// Err is the underlying error.
	Err error

	// Metadata is a map of additional information that can be attached to the
	// error.
	Metadata map[string]string
}

MetaError is an error that can have metadata attached to it. This can be used to send additional information to the SDK or to the user.

func New

func New(err error, metadata map[string]string) *MetaError

New returns a new MetaError with the given error and metadata.

func (MetaError) Error

func (e MetaError) Error() string

Error returns the error message.

Jump to

Keyboard shortcuts

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