Skip to content

Commit

Permalink
Merge pull request #2045 from filmor/non-fatal-package-idx-write
Browse files Browse the repository at this point in the history
Catch errors in writing the package cache
  • Loading branch information
ferd authored Apr 4, 2019
2 parents 645b577 + 5afb118 commit 67ca662
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rebar_packages.erl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ update_package(Name, RepoConfig=#{name := Repo}, State) ->
_ = insert_releases(Name, Releases, Repo, ?PACKAGE_TABLE),
{ok, RegistryDir} = rebar_packages:registry_dir(State),
PackageIndex = filename:join(RegistryDir, ?INDEX_FILE),
ok = ets:tab2file(?PACKAGE_TABLE, PackageIndex);
case ets:tab2file(?PACKAGE_TABLE, PackageIndex) of
ok -> ok;
{error, Error} ->
?WARN("Failed to update package index at ~p: ~p", [PackageIndex, Error])
end;
{error, unverified} ->
?WARN(unverified_repo_message(), [Repo]),
fail;
Expand Down

0 comments on commit 67ca662

Please sign in to comment.