josevalim/elixir — Issue #98: Simplify try/catch to be more like Erlang's
Author: josevalim
Created: 2012-01-10 12:34:26+00:00
State: open
Labels: Feature

Today, our try/catch mechanism looks like:

try do
do_something()
catch: { :error, :badarg, _ }
# Handle
end

We should remove the tuple (it should be implicit as in Erlang) and make it default to throw (as in Erlang). For instance, we could write:

try do
do_something()
catch: :error, :badarg
# Handle
end

And also:

try do
do_something()
catch: 1
# Handle throw 1
end