errors v0.1.0 Errors View Source

Link to this section Summary

Functions

Cause recursively unfurls a passed-in value that implements Cause

Construct a new WrappedError

Wrap an error and message into a WrappedError

Link to this section Functions

Link to this function cause(error) View Source
cause(error :: Errors.Cause.t | any) :: Exception.t | any

Cause recursively unfurls a passed-in value that implements Cause.

It will return the first value that does not implement Cause.

Link to this macro new(message \\ "") View Source (macro)
new(message :: String.t) :: Macro.t

Construct a new WrappedError.

Note that the returned WrappedError will have its error field set to nil. If you want to wrap an existing error, use Errors.wrap/2.

Link to this macro wrap(error, message \\ "") View Source (macro)
wrap(error :: Exception.t, message :: String.t) :: Macro.t

Wrap an error and message into a WrappedError.

This macro automatically passes ENV to the WrappedError. Thus, you should use this function over %WrappedError{} when possible.