Do not expect stacktraces to be always present, closes #4840

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
This commit is contained in:
José Valim
2016-06-21 20:27:01 +02:00
parent 416bf41a03
commit 3ce029615d
+1 -1
View File
@@ -31,7 +31,7 @@ local_for(Module, Name, Arity, Given) ->
{Kind, Ann, [_ | _] = Clauses} when Given == nil; Kind == Given ->
get_function(Ann, Module, Clauses);
_ ->
[_ | T] = erlang:get_stacktrace(),
{current_stacktrace, [_ | T]} = erlang:process_info(self(), current_stacktrace),
erlang:raise(error, undef, [{Module, Name, Arity, []} | T])
end.