From 74096dce2ee85ea5df940155fc2717d249e14d80 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 5 Dec 2024 15:10:56 +0100 Subject: Common API: correctly report failure If fetching via the primary API failed and there is no fallback, we should fail rather than tacitly continuing with the next object to fetch. --- src/buildtool/execution_api/common/common_api.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/buildtool/execution_api/common/common_api.cpp') diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp index 87079602..0ad1b09b 100644 --- a/src/buildtool/execution_api/common/common_api.cpp +++ b/src/buildtool/execution_api/common/common_api.cpp @@ -70,8 +70,8 @@ auto CommonRetrieveToFds( fd); // locally we might be able to fallback to Git in native mode try { - if (fallback and not(*fallback)(info, fd)) { - return false; + if (fallback) { + success = (*fallback)(info, fd); } } catch (std::exception const& ex) { Logger::Log(LogLevel::Error, @@ -83,6 +83,9 @@ auto CommonRetrieveToFds( return false; } } + if (not success) { + return false; + } } else { Logger::Log( -- cgit v1.2.3