[erlang-questions] rpc:call/4

Vinayak Pawar <>
Fri Feb 19 10:26:33 CET 2010


erlang:throw is mainly intended for doing non-local returns from function
instead of error handling. Hence that bit odd rpc:call behaviour?

Regards,
Vinayak

On Thu, Feb 18, 2010 at 2:08 PM, Jayson Vantuyl <> wrote:

> I've encountered unexpected behavior when doing rpc:call/4 to a remote node
> and the remote code has an exception.
>
> The "error case" seems to be {badrpc,Reason}, with reason completely
> unspecified.  Oddly, I get the following behavior:
>
> erlang:exit(X) gives {badrpc, {'EXIT',X}.
> erlang:raise(X) gives {badrpc, {'EXIT',X,StackTrace}.
> erlang:throw(X) gives X.
>
> The first two are pretty reasonable.  The third one is a bit odd.
>
> In a number of places, the rpc:call infrastructure seems to use the
> archaic:
>
> > case catch .... of ... end.
>
> In modern code, I would assume this would be the more expressive:
>
> > try ... of ... catch ... end.
>
> What is the expected behavior (the docs are a bit vague)?
>
> --
> Jayson Vantuyl
> 
>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


More information about the erlang-questions mailing list