Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply invokes all of the mappers that have been added to the given error and returns the resulting error.
Once Apply has been called for an error, the mapping chain is reset.
func MapAfter ¶
MapAfter causes the given mapper to run just after any mappers added by calling MapBefore in an error mapping chain.
func MapBefore ¶
MapBefore causes the given mapper to run just before any mappers added by calling MapAfter in an error mapping chain.
func MapFirst ¶
MapFirst causes the given mapper to run at the very beginning of an error mapping chain.
Types ¶
type MapApplicator ¶
MapApplicator allows an error to control mapping behavior.
An implementor of MapApplicator generally maps a delegate error and then determines what action it needs to take. For example, it may choose to merge the resulting error with itself, or may opt to take no action at all.
Each error that is mapped by this package is tested to see if it implements MapApplicator before Mappers are called.
type Mapper ¶
Mapper constructs a new error from a given error.
Generally, a mapped error should provied an Unwrap method to access the underlying error unless it is deliberately hiding it (because of an API boundary, for example).
type MapperFunc ¶
MapperFunc allows a function to be used as a Mapper.
func (MapperFunc) Map ¶
func (mf MapperFunc) Map(err error) error