aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rlx_prv_release.erl26
-rw-r--r--test/rlx_release_SUITE.erl2
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 112afc8..48c86be 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,