瀏覽代碼

R14B support for ucaught throws

pull/62/head
Andrew Thompson 13 年之前
父節點
當前提交
d3cff8c6d7
共有 2 個檔案被更改,包括 4 行新增1 行删除
  1. +3
    -0
      src/error_logger_lager_h.erl
  2. +1
    -1
      test/crash.erl

+ 3
- 0
src/error_logger_lager_h.erl 查看文件

@ -274,6 +274,9 @@ format_mfa({M, F, A, Props}) when is_list(Props) ->
Line ->
[format_mfa({M, F, A}), io_lib:format(" line ~w", [Line])]
end;
format_mfa([{M, F, A}, _]) ->
%% this kind of weird stacktrace can be generated by a uncaught throw in a gen_server
format_mfa({M, F, A});
format_mfa([{M, F, A, Props}, _]) when is_list(Props) ->
%% this kind of weird stacktrace can be generated by a uncaught throw in a gen_server
format_mfa({M, F, A, Props});

+ 1
- 1
test/crash.erl 查看文件

@ -85,7 +85,7 @@ handle_call(badarity, _, State) ->
F = fun(A, B, C) -> A + B + C end,
Res = F(State),
{reply, Res, State};
handle_call(throw, _, State) ->
handle_call(throw, _, _State) ->
throw(a_ball);
handle_call(_Call, _From, State) ->
{reply, ok, State}.

Loading…
取消
儲存