summaryrefslogtreecommitdiff
path: root/src/other_tools/ops_maps
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2024-06-27 17:45:29 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2024-06-28 10:45:56 +0200
commitdfb361e44d01242eeefa7b554405d37402626766 (patch)
tree007a54ef3ee1c698d7c25c44de01fcf52831e075 /src/other_tools/ops_maps
parent6f331bfa27faa92f848163827ee799b3e2de73c1 (diff)
downloadjustbuild-dfb361e44d01242eeefa7b554405d37402626766.tar.gz
Use (un)expected for network fetch
Diffstat (limited to 'src/other_tools/ops_maps')
-rw-r--r--src/other_tools/ops_maps/content_cas_map.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp
index 651e83fb..013f49c6 100644
--- a/src/other_tools/ops_maps/content_cas_map.cpp
+++ b/src/other_tools/ops_maps/content_cas_map.cpp
@@ -41,15 +41,13 @@ void FetchFromNetwork(ArchiveContent const& key,
return;
}
// now do the actual fetch
- auto res = NetworkFetchWithMirrors(
+ auto data = NetworkFetchWithMirrors(
key.fetch_url, key.mirrors, ca_info, additional_mirrors);
- auto* data =
- std::get_if<1>(&res); // get pointer to fetched data, or nullptr
- if (data == nullptr) {
+ if (not data) {
(*logger)(fmt::format("Failed to fetch a file with id {} from provided "
"remotes:{}",
key.content,
- std::get<0>(res)),
+ data.error()),
/*fatal=*/true);
return;
}