aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_release.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlx_prv_release.erl')
-rw-r--r--src/rlx_prv_release.erl26
1 files changed, 14 insertions, 12 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.