summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-03-16 14:17:20 -0500
committerTristan Sloughter <t@crashfast.com>2015-03-16 14:17:20 -0500
commit80e9aae16c48fc2c60ac763718211821ab9d5881 (patch)
treea6be256e613ae0bcb23f20191b68deacfff50263 /src
parenteba1caca80b21cecf7b7ca697dbdaa1c08bb8b63 (diff)
handle bad package version with error message
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_install_deps.erl4
1 files changed, 3 insertions, 1 deletions
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) ->