aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2013-10-22 12:39:33 -0700
committerJordan Wilberding <[email protected]>2013-10-22 12:39:33 -0700
commite59d0577ac53bddf068a85645cc531378a88751f (patch)
tree5a5589207c0dbe4be33123a4d2e811a260ce5b94
parent47efca2107c671e842c390deb42b9227820ae4ad (diff)
parent4c5f303b737623fbb74fe9553fcc904eccecb723 (diff)
downloadrelx-e59d0577ac53bddf068a85645cc531378a88751f.tar.gz
relx-e59d0577ac53bddf068a85645cc531378a88751f.tar.bz2
relx-e59d0577ac53bddf068a85645cc531378a88751f.zip
Merge pull request #83 from tsloughter/master
improve error message for missing upfrom release
-rw-r--r--src/rlx_prv_assembler.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rlx_prv_assembler.erl b/src/rlx_prv_assembler.erl
index 25fe4ad..b840cfa 100644
--- a/src/rlx_prv_assembler.erl
+++ b/src/rlx_prv_assembler.erl
@@ -115,6 +115,10 @@ format_error({relup_generation_error, CurrentName, UpFromName}) ->
format_error({relup_generation_warning, Module, Warnings}) ->
["Warnings generating relup \s",
rlx_util:indent(2), Module:format_warning(Warnings)];
+format_error({no_upfrom_release_found, undefined}) ->
+ io_lib:format("No earlier release for relup found", []);
+format_error({no_upfrom_release_found, Vsn}) ->
+ io_lib:format("Upfrom release version (~s) for relup not found", [Vsn]);
format_error({relup_script_generation_error,
{relup_script_generation_error, systools_relup,
{missing_sasl, _}}}) ->
@@ -453,8 +457,9 @@ make_script(Options, RunFun) ->
end.
make_relup(State, Release) ->
+ Vsn = rlx_state:upfrom(State),
UpFrom =
- case rlx_state:upfrom(State) of
+ case Vsn of
undefined ->
get_last_release(State, Release);
Vsn ->
@@ -462,7 +467,7 @@ make_relup(State, Release) ->
end,
case UpFrom of
undefined ->
- ?RLX_ERROR(no_upfrom_release_found);
+ ?RLX_ERROR({no_upfrom_release_found, Vsn});
_ ->
make_upfrom_script(State, Release, UpFrom)
end.
@@ -580,7 +585,7 @@ get_up_release(State, Release, Vsn) ->
try
ec_dictionary:get({Name, Vsn}, rlx_state:realized_releases(State))
catch
- throw:notfound ->
+ throw:not_found ->
undefined
end.