diff --git a/Controllers/AsusAuraUSBController/AsusAuraUSBControllerDetect.cpp b/Controllers/AsusAuraUSBController/AsusAuraUSBControllerDetect.cpp index 3e47e665..7d409d9e 100644 --- a/Controllers/AsusAuraUSBController/AsusAuraUSBControllerDetect.cpp +++ b/Controllers/AsusAuraUSBController/AsusAuraUSBControllerDetect.cpp @@ -130,9 +130,10 @@ void DetectAsusAuraUSBMotherboards(hid_device_info* info, const std::string& /*n rgb_controller->name = "ASUS " + dmi.getMainboard(); ResourceManager::get()->RegisterRGBController(rgb_controller); } - catch(std::runtime_error&) + catch(const std::runtime_error& ex) { // reading the config table failed + LOG_ERROR("[AsusAuraUSB] An error occured while reading the config table: %s", ex.what()); } } } diff --git a/Controllers/PhilipsHueController/PhilipsHueController.cpp b/Controllers/PhilipsHueController/PhilipsHueController.cpp index edd6960b..4faf78c4 100644 --- a/Controllers/PhilipsHueController/PhilipsHueController.cpp +++ b/Controllers/PhilipsHueController/PhilipsHueController.cpp @@ -5,6 +5,7 @@ \*---------------------------------------------------------*/ #include "PhilipsHueController.h" +#include "LogManager.h" PhilipsHueController::PhilipsHueController(hueplusplus::Light light_ptr, std::string bridge_ip):light(light_ptr) { @@ -57,9 +58,9 @@ void PhilipsHueController::SetColor(unsigned char red, unsigned char green, unsi { light.setColorRGB(rgb, 0); } - catch(std::exception& e) + catch(const std::exception& e) { - + LOG_ERROR("[PhilipsHueController] An error occured while setting the colors: %s", e.what()); } } @@ -75,7 +76,7 @@ void PhilipsHueController::SetColor(unsigned char red, unsigned char green, unsi } catch(std::exception& e) { - + LOG_ERROR("[PhilipsHueController] An error occured while setting the colors: %s", e.what()); } } } diff --git a/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp b/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp index 12b951d2..90df6464 100644 --- a/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp +++ b/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp @@ -222,9 +222,9 @@ void DetectPhilipsHueControllers(std::vector& rgb_controllers) } } } - catch(std::exception &e) + catch(const std::exception &e) { - LOG_INFO("Exception occurred in Philips Hue detection"); + LOG_INFO("Exception occurred in Philips Hue detection: %s", e.what()); } } } /* DetectPhilipsHueControllers() */ diff --git a/SettingsManager.cpp b/SettingsManager.cpp index 84b4f204..467009e1 100644 --- a/SettingsManager.cpp +++ b/SettingsManager.cpp @@ -10,6 +10,7 @@ \*-----------------------------------------*/ #include "SettingsManager.h" +#include "LogManager.h" #include #include @@ -82,6 +83,8 @@ void SettingsManager::LoadSettings(std::string filename) | parsing failed. Clear out any data in the store | | as it is corrupt. | \*-------------------------------------------------*/ + LOG_ERROR("[SettingsManager] JSON parsing failed: %s", e.what()); + settings_data.clear(); } } @@ -101,7 +104,7 @@ void SettingsManager::SaveSettings() } catch(const std::exception& e) { - + LOG_ERROR("[SettingsManager] Cannot write to file: %s", e.what()); } settings_file.close(); diff --git a/qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp b/qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp index af1cf25a..cf528e2d 100644 --- a/qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp +++ b/qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp @@ -4,6 +4,7 @@ #include #include "filesystem.h" +#include "LogManager.h" #include "OpenRGBPluginsPage.h" #include "ui_OpenRGBPluginsPage.h" @@ -144,9 +145,9 @@ bool Ui::OpenRGBPluginsPage::InstallPlugin(std::string install_file) return true; } - catch(std::exception& e) + catch(const std::exception& e) { - + LOG_ERROR("[PluginsManager] Failed to install plugin: %s", e.what()); } return false;