Imp.Error exception (Imp v0.5.0)

Copy Markdown View Source

Raised by a function whose name ends in ! when the call ran and failed.

:reason is the term the non-raising form of the same function returns as {:error, reason}, so a caller that rescues it can act on the same classes as one that matches the tuple. A call that could never have run, such as one given the wrong kind of argument, raises ArgumentError instead.

Summary

Types

t()

@type t() :: %Imp.Error{__exception__: true, message: String.t(), reason: term()}