[erlang-bugs] rpc:call hide throw

Robert Virding <>
Mon May 14 08:33:24 CEST 2012


erlang:throw/1 does not generate an exception or error, it does a non-local return from a function up to a surrounding catch or try. In this sense this is not an unreasonable return value, it behaves as if there is an implicit catch. If it were to generate an error it would be a 'nocatch' error. See

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

We don't throw errors in erlang. :-)

Robert

----- Original Message -----
> ---------- Forwarded message ----------
> From: Vyacheslav Vorobyov <>
> Date: 2012/5/11
> Subject: rpc:call hide throw
> To: 
> 
> 
> Hello,
> 
> % 1. Good behavior
> {badrpc,{'EXIT', some_reson }} =
> rpc:call(node(),erlang,exit,[some_reson]).
> 
> % 2. Bad behavior
> some_reson = rpc:call(node(),erlang,throw,[some_reson]).
> 
> The second case describes an issue. It makes indistinguishable normal
> result from exception.
> 
> 
> --
> Best Regargs,
>      Vyacheslav
> 
> 
> --
> Best Regargs,
>      Vyacheslav
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
> 


More information about the erlang-bugs mailing list