diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-02-05 23:14:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-05 23:14:29 -0500 |
commit | b6bd27f2ffbe8c802d54b77371d3f0828eb9d471 (patch) | |
tree | 928bdfe1727d6df9e40607c46032957395bfcd9d /src | |
parent | 95ef84953b3f40b83126f00f0746f7918d607315 (diff) | |
parent | 5da09d2d44947952622563ad89e2f2d827af50f4 (diff) |
Merge pull request #1472 from talentdeficit/REBAR-1469
catch badarg exception from eunit in `rebar_prv_eunit`
Diffstat (limited to 'src')
-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(). |