arjan / decorator

Function decorators for Elixir
MIT License
385 stars 20 forks source link

Support `catch` as part of `do`-block #45

Closed tverlaan closed 3 years ago

tverlaan commented 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.

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
arjan commented 3 years ago

Nice "catch"!! :rofl: