error v0.4.2 Error View Source
Model domain and infrastructure errors as regular data.
Link to this section Summary
Functions
Extract the cause of an error (of type Error.t()
).
Return the map of detailed information supplied at Error
creation.
Create a domain
error, with a reason and optional details.
Flattens the given error and all its nested causes into a list.
Create an infra
error, with a reason and optional details.
A guard to use in order to pattern match errors. Will match on Domain errors, but not Infra errors.
A guard to use in order to pattern match errors. Will match on both Infra and Domain Errors.
A guard to use in order to pattern match errors. Will match on Infra errors, but not Domain errors.
Determine whether a given Error
is a domain
or infra
error.
Map a function on the details
map in an Error
.
Return the reason the Error
was created with.
Extracts the root cause of the given error.
Wrap a higher-level error 'on top' of a lower-level error.
Link to this section Types
Link to this section Functions
Extract the cause of an error (of type Error.t()
).
Think of this as inspecting deeper into the stack trace.
Return the map of detailed information supplied at Error
creation.
Create a domain
error, with a reason and optional details.
Flattens the given error and all its nested causes into a list.
The given error is always the first element of resulting list.
Create an infra
error, with a reason and optional details.
A guard to use in order to pattern match errors. Will match on Domain errors, but not Infra errors.
A guard to use in order to pattern match errors. Will match on both Infra and Domain Errors.
A guard to use in order to pattern match errors. Will match on Infra errors, but not Domain errors.
Determine whether a given Error
is a domain
or infra
error.
Map a function on the details
map in an Error
.
Useful for adding extra details, modifying exisint ones, or removing them.
Return the reason the Error
was created with.
Extracts the root cause of the given error.
The root cause of an error without an underlying cause is the error itself.
Convert an Error
to an Elixir map.
Wrap a higher-level error 'on top' of a lower-level error.
Think of this as a stack trace, but in domain-model terms.