[erlang-questions] Handling unexpected messages (was Re: Erlangshell crashes)

Logan, Martin <>
Mon Oct 30 17:59:05 CET 2006

-----Original Message-----
[mailto:] On Behalf Of Sean Hinde
Sent: Monday, October 30, 2006 5:43 AM
To: Christian S
Subject: Re: [erlang-questions] Handling unexpected messages (was Re:
Erlangshell crashes)

On 30 Oct 2006, at 11:12, Christian S wrote:

> On 10/30/06, Ben Butler-Cole <> wrote:
>> I'm writing my first Erlang system and need to decide general  
>> policies for this kind of thing. Is there not an argument for  
>> exiting if you get an unexpected message rather than just ignoring  
>> it? I suppose that opens you up to a denial of service attack if  
>> your Pids or process names aren't completely secure.

I tend to let things crash.  The reason being, there should be no
unexpected messages to any of your processes, if you have one, it is
just like any other error in Erlang. The basic way of handling errors in
Erlang to let the process crash, then be restored to its base state
through supervision.  You will get an error in your SASL log if you have
it enabled - which you should.   There are exceptions to this; for
example sometimes you need to provide user feedback on an error.  If you
are faced with one of these exceptions then do what you must, otherwise
stick to the tried and true, simple and clean, paradigm of crash only


More information about the erlang-questions mailing list