Closed dominicletz closed 3 hours ago
The warning is correct. rescue
only rescues exceptions, all Erlang errors are normalized into a single %ErlangError{}
or you can use catch :error, :data_error
.
To be clear, either do rescue _ -> term
or rescue ErlangError -> _
. The :data_error
is not doing anything.
Thanks for clarifying, I've no idea how I got to this construct above - but I did believe it would catch the specific :data_error subtype...
Elixir and Erlang/OTP versions
$ elixir -v Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
Operating system
Ubuntu
Current behavior
Expected behavior