summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-05 15:10:56 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-13 16:22:13 +0100
commitea4c45e02f3b8e7015baa65ecdb10fbbc49df1fc (patch)
tree0551a7cac7371461d1264de7e06e67bfa5adf5d0 /src
parent0ddce95c7ed1dd3dd0a5df31138b58a87e11821b (diff)
downloadjustbuild-ea4c45e02f3b8e7015baa65ecdb10fbbc49df1fc.tar.gz
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. (cherry-picked from 74096dce2ee85ea5df940155fc2717d249e14d80)
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/common/common_api.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp
index c21d14a4..7466abbf 100644
--- a/src/buildtool/execution_api/common/common_api.cpp
+++ b/src/buildtool/execution_api/common/common_api.cpp
@@ -58,8 +58,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,
@@ -71,6 +71,9 @@ auto CommonRetrieveToFds(
return false;
}
}
+ if (not success) {
+ return false;
+ }
}
else {
Logger::Log(