summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralisdair sullivan <alisdairsullivan@gmail.com>2017-02-05 18:32:33 -0800
committeralisdair sullivan <alisdairsullivan@gmail.com>2017-02-05 18:32:33 -0800
commit5da09d2d44947952622563ad89e2f2d827af50f4 (patch)
tree928bdfe1727d6df9e40607c46032957395bfcd9d
parent95ef84953b3f40b83126f00f0746f7918d607315 (diff)
catch badarg exception from eunit in `rebar_prv_eunit`
fixes #1469
-rw-r--r--src/rebar_prv_eunit.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 7d44137..65addc3 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -83,13 +83,16 @@ run_tests(State, Tests) ->
EUnitOpts = resolve_eunit_opts(State),
?DEBUG("eunit_tests ~p", [T]),
?DEBUG("eunit_opts ~p", [EUnitOpts]),
- Result = eunit:test(T, EUnitOpts),
- ok = maybe_write_coverdata(State),
- case handle_results(Result) of
- {error, Reason} ->
- ?PRV_ERROR(Reason);
- ok ->
- {ok, State}
+ try eunit:test(T, EUnitOpts) of
+ Result ->
+ ok = maybe_write_coverdata(State),
+ case handle_results(Result) of
+ {error, Reason} ->
+ ?PRV_ERROR(Reason);
+ ok ->
+ {ok, State}
+ end
+ catch error:badarg -> ?PRV_ERROR({error, badarg})
end.
-spec format_error(any()) -> iolist().