Closed tverlaan closed 3 years ago
Elixir automatically wraps the body of do in a try-block when one of the keywords rescue, catch or after is specified. They can also be used in conjunction with eachother.
do
try
rescue
catch
after
This solves the following compilation error that I got on a catch:
== Compilation error in file test/exception_test.exs == ** (CompileError) test/exception_test.exs:32: unhandled operator -> (stdlib 3.13.2) lists.erl:1358: :lists.mapfoldl/3 (stdlib 3.13.2) lists.erl:1359: :lists.mapfoldl/3 (stdlib 3.13.2) lists.erl:1358: :lists.mapfoldl/3 (stdlib 3.13.2) lists.erl:1359: :lists.mapfoldl/3
Nice "catch"!! :rofl:
Elixir automatically wraps the body of
do
in atry
-block when one of the keywordsrescue
,catch
orafter
is specified. They can also be used in conjunction with eachother.This solves the following compilation error that I got on a
catch
: