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(-) (limited to 'src') 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