diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-04 17:47:23 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-04 17:47:23 -0400 |
commit | 4bdfb1ff9f8f781f80448c11574ef753e31be26a (patch) | |
tree | cf538b3ae0545158b0c6c0866452a17fbd3b7aa2 /src/rebar_prv_update.erl | |
parent | f91e4a570ca3aa992f79a8f28d0c2ac43c3e9a12 (diff) | |
parent | ce74589a56e14150493540302ce61d498cee0b27 (diff) |
Merge pull request #387 from tsloughter/missing_pkg
handle missing package in registry by skipping
Diffstat (limited to 'src/rebar_prv_update.erl')
-rw-r--r-- | src/rebar_prv_update.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl index d0ff889..973b275 100644 --- a/src/rebar_prv_update.erl +++ b/src/rebar_prv_update.erl @@ -52,7 +52,8 @@ do(State) -> write_registry(Dict, Graph, State), ok catch - _E:_C -> + _E:C -> + ?DEBUG("Error creating package index: ~p ~p", [C, erlang:get_stacktrace()]), throw(?PRV_ERROR(package_index_write)) end, @@ -94,9 +95,13 @@ update_graph(Pkg, PkgVsn, Deps, HexRegistry, Graph) -> lists:foldl(fun([Dep, DepVsn, false, _AppName | _], DepsListAcc) -> case DepVsn of <<"~> ", Vsn/binary>> -> - HighestDepVsn = rebar_packages:find_highest_matching(Dep, Vsn, HexRegistry), - digraph:add_edge(Graph, {Pkg, PkgVsn}, {Dep, HighestDepVsn}), - [{Dep, DepVsn} | DepsListAcc]; + case rebar_packages:find_highest_matching(Dep, Vsn, HexRegistry) of + {ok, HighestDepVsn} -> + digraph:add_edge(Graph, {Pkg, PkgVsn}, {Dep, HighestDepVsn}), + [{Dep, DepVsn} | DepsListAcc]; + none -> + DepsListAcc + end; Vsn -> digraph:add_edge(Graph, {Pkg, PkgVsn}, {Dep, Vsn}), [{Dep, Vsn} | DepsListAcc] |