aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2014-11-16 11:08:43 -0600
committerTristan Sloughter <[email protected]>2014-11-22 20:07:08 -0600
commit2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80 (patch)
treec2c10db7b6834d7ed9b88a2fc2fc3c7ed3e9e5aa /src
parentfb9fd6019235186a0a22f4c0b6d6ace21d6c36a0 (diff)
downloadrelx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.tar.gz
relx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.tar.bz2
relx-2c9d7f4d79cb66f1bc306cac86d7ed02489b0f80.zip
fix for error message output for no default release
Diffstat (limited to 'src')
-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.