diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-27 17:45:29 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-28 10:45:56 +0200 |
commit | dfb361e44d01242eeefa7b554405d37402626766 (patch) | |
tree | 007a54ef3ee1c698d7c25c44de01fcf52831e075 /src/other_tools/ops_maps | |
parent | 6f331bfa27faa92f848163827ee799b3e2de73c1 (diff) | |
download | justbuild-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.cpp | 8 |
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; } |