[erlang-questions] wanted: example of try/catch

Bjorn Gustavsson bjorn@REDACTED
Fri Dec 8 16:17:47 CET 2006


Section 6.19 in the Reference Manual describes try/catch.

/Bjorn

Bengt Kleberg <bengt.kleberg@REDACTED> writes:

> greetings,
> 
> i am trying to use try/catch. the documentatin i have is the EUC 2004 
> paper ''Erlang's exception handling revisited''. it has lead me to 
> belive that this super simple example should produce 'kalle' in the 
> erlang shell:
> 
> try false = true catch Error -> kalle end.
> 
> it does not. i get:
> ** exited: {{badmatch,true},[{erl_eval,expr,3}]} **
> 
> 
> is there an alternative reading to ''Erlang's exception handling 
> revisited''?
> or is there a simple explanation as to why my example does not work?
> 
> 
> bengt
> -- 
>     EPO guidelines 1978: "If the contribution to the known art resides
>     solely in a computer program then the subject matter is not
>     patentable in whatever manner it may be presented in the claims."
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB




More information about the erlang-questions mailing list