[erlang-questions] Programming question

Sean Hinde <>
Thu Jan 25 12:47:55 CET 2007

On 25 Jan 2007, at 08:23, Mats Cronqvist wrote:

> Sean Hinde wrote:
>> One fix might be for gen:call() to issue another exit signal towards
>> the calling process after returning the result.
>    surely if you catch the exit and it turns out you really wanted  
> it, you
> should re-throw?
>    how about
> try
>    Res = gen_server:call(PidA, {op, stuff}),
>    S1 = process(Res, S),
>    loopB(PidA, S1)
> catch
>    C:R ->
>      case is_process_alive(PidA) of
>        true -> loopB(PidA,dosomething({C,R},S));
>        false -> exit({C,R})
>      end
> end

This would work, but my is it ugly - how is anyone supposed to  
remember to do that every time they want to be sure that the called  
process has gone down (as opposed to any other reason for the call to  
thrown an exception).

The problem as I see it is that the calling process only sometimes  
get its 'EXIT' message - it depends on context.


More information about the erlang-questions mailing list