summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common/common_api.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-05 15:10:56 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-05 15:15:46 +0100
commit74096dce2ee85ea5df940155fc2717d249e14d80 (patch)
tree3963eb4383fbcece1b3bed625f093742d5c310b8 /src/buildtool/execution_api/common/common_api.cpp
parentca952159e778f0ed927082832a195842f6229a94 (diff)
downloadjustbuild-74096dce2ee85ea5df940155fc2717d249e14d80.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.
Diffstat (limited to 'src/buildtool/execution_api/common/common_api.cpp')
-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 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(