Permalink
Browse files

Merge pull request #36 from samuelrivas/fix-stacktrace-cleanup

don't clean the stacktrace if the error is a bad use of a proper function
  • Loading branch information...
kostis committed Apr 22, 2012
2 parents deeb575 + c09f24f commit 91dce2bf2bc9ea656f6d704a6662b541c898f161
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/proper.erl
View
@@ -1399,7 +1399,12 @@ threw_exception_aux(Fun, TopMod, TopName, TopArgs) ->
-spec clean_stacktrace(stacktrace()) -> stacktrace().
clean_stacktrace(RawTrace) ->
{Trace,_Rest} = lists:splitwith(fun is_not_proper_call/1, RawTrace),
- Trace.
+ %% If the clean trace is empty it's probably because of a bad call to
+ %% the proper API, so we let the whole stacktrace through
+ case Trace of
+ [] -> RawTrace;
+ _ -> Trace
+ end.
-spec is_not_proper_call(call_record()) -> boolean().
-ifdef(OLD_STACKTRACE_FORMAT).

0 comments on commit 91dce2b

Please sign in to comment.