[erlang-questions] Supervisor Linked to Shell

Hans Bolinder hans.bolinder@REDACTED
Mon Apr 26 08:49:53 CEST 2010


[David N Murray <dmurray@REDACTED>:]
> I'm developing in Emacs. If I make a mistake in the shell, it brings
> down the supervisor:
> 
> 129> crash().
> ** exception error: undefined shell command crash/0
>      in function  erlang:error/1
>         called as erlang:error({shell_undef,crash,0})
...
> How can I prevent this?

You could try the function shell:catch_exception/1

    http://www.erlang.org/doc/man/shell.html#catch_exception-1

or the STDLIB configuration parameter 'shell_catch_exception'

    http://www.erlang.org/doc/man/STDLIB_app.html

The latter could for instance be set by 

    export ERL_FLAGS="-stdlib shell_catch_exception true"

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson


More information about the erlang-questions mailing list