From 33c3f91885429b60cab551e761f297a640aff7d5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 7 Sep 2018 16:35:48 +0200 Subject: [PATCH] Handle queryPathInfo() failure from substituters when fallback is enabled Fixes #1990. --- src/libstore/build.cc | 7 +++++++ src/libstore/local-store.cc | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index cd37f7a3f..96ca28742 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -3682,6 +3682,13 @@ void SubstitutionGoal::tryNext() } catch (InvalidPath &) { tryNext(); return; + } catch (Error & e) { + if (settings.tryFallback) { + printError(e.what()); + tryNext(); + return; + } + throw; } /* Update the total expected download size. */ diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index c91dbf241..5e392c237 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -880,6 +880,11 @@ void LocalStore::querySubstitutablePathInfos(const PathSet & paths, narInfo ? narInfo->fileSize : 0, info->narSize}; } catch (InvalidPath) { + } catch (Error & e) { + if (settings.tryFallback) + printError(e.what()); + else + throw; } } }