diff options
author | Tristan Sloughter <[email protected]> | 2014-11-16 11:08:43 -0600 |
---|---|---|
committer | Tristan Sloughter <[email protected]> | 2014-11-22 20:07:08 -0600 |
commit | 2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80 (patch) | |
tree | c2c10db7b6834d7ed9b88a2fc2fc3c7ed3e9e5aa | |
parent | fb9fd6019235186a0a22f4c0b6d6ace21d6c36a0 (diff) | |
download | relx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.tar.gz relx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.tar.bz2 relx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.zip |
fix for error message output for no default release
-rw-r--r-- | src/rlx_prv_release.erl | 26 | ||||
-rw-r--r-- | test/rlx_release_SUITE.erl | 2 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/rlx_prv_release.erl b/src/rlx_prv_release.erl index 83c9e6d..95a31e8 100644 --- a/src/rlx_prv_release.erl +++ b/src/rlx_prv_release.erl @@ -97,19 +97,21 @@ create_dep_graph(State) -> -spec find_default_release(rlx_state:t(), rlx_depsolver:t()) -> {ok, rlx_state:t()} | relx:error(). find_default_release(State, DepGraph) -> - try rlx_state:default_configured_release(State) of - {undefined, undefined} -> - resolve_default_release(State, DepGraph); - {RelName, undefined} -> - resolve_default_version(State, DepGraph, RelName); - {undefined, Vsn} -> - ?RLX_ERROR({no_release_name, Vsn}); - {RelName, RelVsn} -> - solve_release(State, DepGraph, RelName, RelVsn); - undefined -> - ?RLX_ERROR(no_releases_in_system) + try + case rlx_state:default_configured_release(State) of + {undefined, undefined} -> + resolve_default_release(State, DepGraph); + {RelName, undefined} -> + resolve_default_version(State, DepGraph, RelName); + {undefined, Vsn} -> + ?RLX_ERROR({no_release_name, Vsn}); + {RelName, RelVsn} -> + solve_release(State, DepGraph, RelName, RelVsn); + undefined -> + ?RLX_ERROR(no_releases_in_system) + end catch - {multiple_release_names, _, _}=Error -> + throw:{multiple_release_names, _, _}=Error -> ?RLX_ERROR(Error) end. diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl index 6ae4f24..837e030 100644 --- a/test/rlx_release_SUITE.erl +++ b/test/rlx_release_SUITE.erl @@ -139,7 +139,7 @@ make_extend_release(Config) -> OutputDir = filename:join([proplists:get_value(data_dir, Config), create_random_name("relx-output")]), - ?assertMatch({multiple_release_names,foo_test,foo}, + ?assertMatch({error, {rlx_prv_release, {multiple_release_names,foo_test,foo}}}, catch relx:do(undefined, undefined, [], [LibDir1], 3, OutputDir, ConfigFile)), {ok, State} = relx:do(foo_test, undefined, [], [LibDir1], 3, |