From 9e9a91a04891c554c564e49369f327919156197f Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Tue, 8 Dec 2020 14:04:11 +0530 Subject: [PATCH] SettingsManager: Catch exception with constant reference parameter. This fixes warning: catching polymorphic type 'class std::exception' by value. --- SettingsManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SettingsManager.cpp b/SettingsManager.cpp index 67f44e6b..84b4f204 100644 --- a/SettingsManager.cpp +++ b/SettingsManager.cpp @@ -75,7 +75,7 @@ void SettingsManager::LoadSettings(std::string filename) { settings_file >> settings_data; } - catch(std::exception e) + catch(const std::exception& e) { /*-------------------------------------------------*\ | If an exception was caught, that means the JSON | @@ -99,7 +99,7 @@ void SettingsManager::SaveSettings() { settings_file << settings_data.dump(4); } - catch(std::exception e) + catch(const std::exception& e) { }