[erlang-questions] gen_server:call/2 exceptions?

Robert Virding robert.virding@REDACTED
Sat Jun 8 18:24:29 CEST 2013


Again IIRC it the gen_server:call itself which generates an exception when it detects that the server has dies. If so just doing 

catch gen_server:call (...) 

will stop the calling process from crashing. You will then need a case to check if you got a reply or the server died. 

Robert 

----- Original Message -----

> From: "Sungjin Park" <jinni.park@REDACTED>
> To: "erlang-questions" <erlang-questions@REDACTED>
> Sent: Saturday, 8 June, 2013 6:20:06 PM
> Subject: Re: [erlang-questions] gen_server:call/2 exceptions?

> Then there is no way to catch it, right?

> On Sun, Jun 9, 2013 at 12:41 AM, Robert Virding <
> robert.virding@REDACTED > wrote:

> > IIRC it can if the server to which it has sent the call terminates
> > with the reason 'normal' before sending a reply.
> 

> > Robert
> 

> > > From: "Sungjin Park" < jinni.park@REDACTED >
> > 
> 
> > > To: "erlang-questions" < erlang-questions@REDACTED >
> > 
> 
> > > Sent: Saturday, 8 June, 2013 4:56:54 AM
> > 
> 
> > > Subject: [erlang-questions] gen_server:call/2 exceptions?
> > 
> 

> > > When does gen_server:call/2 throw an exception as {'EXIT',
> > > normal}?
> > 
> 

> > > --
> > 
> 
> > > Park, Sungjin
> > 
> 
> > > -------------------------------------------------------------------------------------------------------------------
> > 
> 
> > > Peculiar travel suggestions are dancing lessons from god.
> > 
> 
> > > -- The Books of Bokonon
> > 
> 
> > > -------------------------------------------------------------------------------------------------------------------
> > 
> 
> > > _______________________________________________
> > 
> 
> > > erlang-questions mailing list
> > 
> 
> > > erlang-questions@REDACTED
> > 
> 
> > > http://erlang.org/mailman/listinfo/erlang-questions
> > 
> 

> --
> Park, Sungjin
> -------------------------------------------------------------------------------------------------------------------
> Peculiar travel suggestions are dancing lessons from god.
> -- The Books of Bokonon
> -------------------------------------------------------------------------------------------------------------------
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130608/6776ad01/attachment.htm>


More information about the erlang-questions mailing list