Elixir encourages developers to use try .. rescue to catch
exceptions instead of try ... catch :error, exception, because
the latter form doesn't convert Erlang errors to Elixir exceptions.
For example, if compensation action contains a bug and calls
non-existent module or function, then this error will be swallowed
by function return_or_reraise, which will raise something like
:undef.exception/1 is undefined and original exception will be lost.
Coverage remained the same at 100.0% when pulling e8de6c8a68b7fd4133fee01d87e209c10f95770b on take-five:error-handling into 73a51d508b3bccaf009ad74347d09c930eeb8e50 on Nebo15:master.
Elixir encourages developers to use
try .. rescue
to catch exceptions instead oftry ... catch :error, exception
, because the latter form doesn't convert Erlang errors to Elixir exceptions.For example, if compensation action contains a bug and calls non-existent module or function, then this error will be swallowed by function
return_or_reraise
, which will raise something like:undef.exception/1 is undefined
and original exception will be lost.