package errdata
import "github.com/zeebo/errs/errdata"
Package errdata helps with associating some data to error classes
Index ¶
- func Get(err error, key interface{}) interface{}
- func Set(class *errs.Class, key interface{}, value interface{})
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 ¶
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 ¶
- Version
- v1.2.2
- Published
- Jun 17, 2019
- Platform
- js/wasm
- Imports
- 2 packages
- Last checked
- 1 week ago –
Tools for package owners.