From a64bd6b0c8c243f69ffd961e2b83527e963cd4b6 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 16 Dec 2024 22:15:15 +0000 Subject: [PATCH] Catch exception when failing to open archive during search --- components/core/src/clp_s/clp-s.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/core/src/clp_s/clp-s.cpp b/components/core/src/clp_s/clp-s.cpp index e46b7daf3..0ec09b5b8 100644 --- a/components/core/src/clp_s/clp-s.cpp +++ b/components/core/src/clp_s/clp-s.cpp @@ -353,7 +353,12 @@ int main(int argc, char const* argv[]) { auto archive_reader = std::make_shared(); for (auto const& archive_path : command_line_arguments.get_input_paths()) { - archive_reader->open(archive_path, command_line_arguments.get_network_auth()); + try { + archive_reader->open(archive_path, command_line_arguments.get_network_auth()); + } catch (std::exception const& e) { + SPDLOG_ERROR("Failed to open archive - {}", e.what()); + return 1; + } if (false == search_archive( command_line_arguments,