[erlang-questions] Unexpected try/catch behaviour

Richard O'Keefe ok@REDACTED
Wed Feb 24 00:11:44 CET 2010


On Feb 24, 2010, at 12:36 AM, Attila Rajmund Nohl wrote:

> 2010/2/23, Ulf Wiger <ulf.wiger@REDACTED>:
> [...]
>> From the Erlang Reference Manual:
>>
>>
>> An exception occurring during the evaluation of Body is not caught."
>
> This is um, surprising, even by the standards of Erlang... I mean not
> the documentation, but the actual language construct.

I had forgotten about try...of...catch...end.
When is it appropriate to use try E of H catch ... end
instead of try case E of H end catch ... end?

I think the _intent_ is clear, that in try E ... end
it is *only* E that is protected.

It does make sense, but it would be really nice to see
a couple of examples where try .. of .. catch .. end was
the right thing to do.




More information about the erlang-questions mailing list