Let it crash?

David Hopwood david.nospam.hopwood@REDACTED
Thu Aug 19 23:27:36 CEST 2004


Inswitch Solutions - Erlang Evaluation wrote:
> Philosphy in Erlang is "Let it crash".
> Looking at the source code of Erlang OTP I have seen use of catch statements.
> 
> My question is when should I use catch in my code or set trap_exit flag in true?

Generally, you should catch when you can recover from an exception in a way
that conforms to the original specification of the operation being performed.

(This assumes another exception does not occur; if it can then make sure
that can't lead to an infinite loop of catches.)

-- 
David Hopwood <david.nospam.hopwood@REDACTED>




More information about the erlang-questions mailing list