From dfb361e44d01242eeefa7b554405d37402626766 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Thu, 27 Jun 2024 17:45:29 +0200 Subject: Use (un)expected for network fetch --- src/other_tools/ops_maps/content_cas_map.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/other_tools/ops_maps') 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; } -- cgit v1.2.3