diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2019-04-04 10:31:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-04 10:31:38 -0400 |
commit | 67ca662364a7571b890a7aaef22c1cbf81e4643f (patch) | |
tree | 419fcc24e8f8cd6bfd97adbd3b438e437b4b6e41 /src | |
parent | 645b5774b0ccbf786d4a2d84b1c266de5fbdef59 (diff) | |
parent | 5afb1183327400b379ec0b2519bc36c1623bc1d0 (diff) |
Merge pull request #2045 from filmor/non-fatal-package-idx-write
Catch errors in writing the package cache
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_packages.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_packages.erl b/src/rebar_packages.erl index a260e47..c7bbfac 100644 --- a/src/rebar_packages.erl +++ b/src/rebar_packages.erl @@ -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; |