catch link(Pid) when trapping exits
Francesco Cesarini (Erlang Training & Consulting)
francesco@REDACTED
Thu Oct 27 11:34:26 CEST 2005
> It is all there, really. Only it was written before exceptions
> were invented as a concept in Erlang, uses the term
> "exit signal" in a confusing way and lies about "does not fail".
> Ok, it is maybe dead wrong, but the intention was right.
> So, what happens is:
>
> link(Pid) -> true if Pid exists or the caller has
> process_flag(trap_exit, true).
> error(noproc) otherwise
>
> The enclosing catch evaluates to {'EXIT',{noproc,Stackdump}}
> for error(noproc).
>
> Weird behaviour, in my opinion..
Exactly my point. Would it not be better to return error(noproc) even if
trapping exits instead of exit(Pid, Reason)?
Francesco
--
http://www.erlang-consulting.com
More information about the erlang-questions
mailing list