diff options
author | alisdair sullivan <alisdairsullivan@gmail.com> | 2017-02-05 18:32:33 -0800 |
---|---|---|
committer | alisdair sullivan <alisdairsullivan@gmail.com> | 2017-02-05 18:32:33 -0800 |
commit | 5da09d2d44947952622563ad89e2f2d827af50f4 (patch) | |
tree | 928bdfe1727d6df9e40607c46032957395bfcd9d | |
parent | 95ef84953b3f40b83126f00f0746f7918d607315 (diff) |
catch badarg exception from eunit in `rebar_prv_eunit`
fixes #1469
-rw-r--r-- | src/rebar_prv_eunit.erl | 17 |
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(). |