|
Re: catching errors from linked processes: simplest way?: msg#00328lang.erlang.general
You could add some supervision to the client by using a toplevel catch. Then you will get a stack dump. The following code also demonstrates a line number macro trick with the process dictionary that is possible if you have a toplevel catch in the client. Runtime result: 21> test:top(). {'EXIT',{{badmatch,b}, [{test,foo,0}, {test,do,0}, {test,top,0}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]}} at test:22 error / Raimo Niskanen, Erlang/OTP, Ericsson AB -module(test). -export([top/0]). -define(line, put(location,{?MODULE,?LINE}),). top() -> ?line case catch do() of {'EXIT',_} = Exit -> {Module,Line} = get(location), io:format("~p at ~w:~w~n", [Exit,Module,Line]), error; Result -> {ok,Result} end. do() -> ?line foo(), ?line bar(). foo() -> ?line a=b. bar() -> ok. Chris Pressey wrote: On Tue, 22 Apr 2003 15:35:16 -0500 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Call for Papers: III CMSRA: 00328, Luís Moniz Pereira |
|---|---|
| Next by Date: | Re: catching errors from linked processes (Long): 00328, Jay Nelson |
| Previous by Thread: | Re: catching errors from linked processes: simplest way?i: 00328, Lennart Öhman |
| Next by Thread: | Re: catching errors from linked processes: simplest way?: 00328, Ulf Wiger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |