package errdata

import "github.com/zeebo/errs/errdata"

Package errdata helps with associating some data to error classes

Index

Functions

func Get

func Get(err error, key interface{}) interface{}

Get returns the value associated to the key for the error if any of the classes the error is part of have a value associated for that key.

func Set

func Set(class *errs.Class, key interface{}, value interface{})

Set associates the value for the given key and class. Errors wrapped by the class will return the value in the call to Get for the key.

Source Files

errdata.go

Version
v0.2.0
Published
May 5, 2018
Platform
js/wasm
Imports
2 packages
Last checked
1 week ago

Tools for package owners.