From 80e9aae16c48fc2c60ac763718211821ab9d5881 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 16 Mar 2015 14:17:20 -0500 Subject: handle bad package version with error message --- src/rebar_prv_install_deps.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 48402da..59acb54 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -97,6 +97,8 @@ do(State) -> end. -spec format_error(any()) -> iolist(). +format_error({bad_constraint, Name, Constraint}) -> + io_lib:format("Unable to parse version for package ~s: ~s", [Name, Constraint]); format_error({parse_dep, Dep}) -> io_lib:format("Failed parsing dep ~p", [Dep]); format_error({missing_package, Package, Version}) -> @@ -510,7 +512,7 @@ parse_goal(Name, Constraint) -> {match, [Op, Vsn]} -> {Name, Vsn, binary_to_atom(Op, utf8)}; nomatch -> - fail + throw(?PRV_ERROR({bad_constraint, Name, Constraint})) end. warn_skip_deps(AppInfo, State) -> -- cgit v1.1 From cfd10b82f11c7931ebd5aac31821684e6c7fcd0a Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 16 Mar 2015 14:33:01 -0500 Subject: add back throw on package index write --- src/rebar_prv_update.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl index e851f7b..170c591 100644 --- a/src/rebar_prv_update.erl +++ b/src/rebar_prv_update.erl @@ -49,7 +49,7 @@ do(State) -> ok catch _E:_C -> - ?PRV_ERROR(package_index_write) + throw(?PRV_ERROR(package_index_write)) end, {ok, State}. -- cgit v1.1