From 3781301ff888dee3782f41cc97d3efc4e02991f4 Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Mon, 13 Jan 2025 18:19:06 -0800 Subject: [PATCH] unit_json_factory.cpp: catch std::exception instead of boost::json::system_error --- engine/src/cmd/unit_json_factory.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/src/cmd/unit_json_factory.cpp b/engine/src/cmd/unit_json_factory.cpp index c483960532..059122bb7d 100644 --- a/engine/src/cmd/unit_json_factory.cpp +++ b/engine/src/cmd/unit_json_factory.cpp @@ -1,8 +1,7 @@ /* * unit_csv_factory.cpp * - * Copyright (C) 2021 Roy Falk - * Copyright (C) 2022 Stephen G. Tuggy + * Copyright (C) 2021-2025 Roy Falk and Stephen G. Tuggy * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -42,8 +41,8 @@ void UnitJSONFactory::ParseJSON(VSFileSystem::VSFile &file, bool player_ship) { boost::json::value json_value; try { json_value = boost::json::parse(json_text); - } catch (boost::json::system_error& e) { - VS_LOG_FLUSH_EXIT(fatal, "Error parsing JSON in UnitJSONFactory::ParseJSON()", e.code().value()); + } catch (std::exception const& e) { + VS_LOG_FLUSH_EXIT(fatal, (boost::format("Error parsing JSON in UnitJSONFactory::ParseJSON(): %1%") % e.what()), 42); } boost::json::array root_array = json_value.get_array();