Catch

Maurice Castro maurice@REDACTED
Tue Nov 20 21:36:50 CET 2001


Fredrik writes:

> I also recognise the problem of having a lot of catch-and-throw
> encapsulations, however does this problem not arise from the fact that a
> catch in erlang always catched everything, and there is no way to only catch
> a particluar exception.
> 
> One of the benefits of the given proposal is that it would become possible
> to have such constructs. It would also be possible to have catch-throw
> encapsulation completely hidden within one module, without any .
> 

Personally, I find the fact that catch catches everything to be a desirable
feature. This makes the handling of exceptions at a particular catch explicit.
When attempting to understand the behaviour of a program which uses exceptions
it is particularly desirable that the exceptions not propogate up the call
chain. Furthermore, if propogation is required, making it explicit warns the
programmer that this is the desired behaviour.

	Maurice Castro



More information about the erlang-questions mailing list