[erlang-bugs] rpc:call hide throw

Vyacheslav Vorobyov <>
Mon May 14 16:17:42 CEST 2012


Let me disagree with "erlang:throw/1 does not generate an exception".

Am I wrong addressing you to
http://www.erlang.org/doc/reference_manual/errors.html#id81437. I
think it does generate exception of class 'throw' ;-)

About "We don't throw errors in erlang.", probably yes, but we also
don't want to loose (hide) information when using rpc:call.
Information about HOW value returned. Currently rpc:call provides us
with doubtful "service" it decides for us that normally returned value
and thrown one are "equally good".

2012/5/14 Robert Virding <>:
> 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
>>



-- 
Best Regargs,
     Vyacheslav


More information about the erlang-bugs mailing list