From 1c882508ec94ee555c0fc38e4b871f39f4b0e9a9 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 19 Oct 2016 02:15:52 +0200 Subject: [PATCH] fix: Drop superflous prefix when throwing module_error --- include/modules/battery.hpp | 4 ++-- include/modules/script.hpp | 4 ++-- include/modules/volume.hpp | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/modules/battery.hpp b/include/modules/battery.hpp index 0c648026..df2156b6 100644 --- a/include/modules/battery.hpp +++ b/include/modules/battery.hpp @@ -34,9 +34,9 @@ namespace modules { // Validate paths {{{ if (!file_util::exists(m_path_capacity)) - throw module_error("battery_module: The file '" + m_path_capacity + "' does not exist"); + throw module_error("The file '" + m_path_capacity + "' does not exist"); if (!file_util::exists(m_path_adapter)) - throw module_error("battery_module: The file '" + m_path_adapter + "' does not exist"); + throw module_error("The file '" + m_path_adapter + "' does not exist"); // }}} // Add formats and elements {{{ diff --git a/include/modules/script.hpp b/include/modules/script.hpp index 5f47d335..273cad13 100644 --- a/include/modules/script.hpp +++ b/include/modules/script.hpp @@ -69,7 +69,7 @@ namespace modules { } } catch (const std::exception& err) { m_log.err("%s: %s", name(), err.what()); - throw module_error(name() + ": Failed to execute tail command, stopping module..."); + throw module_error("Failed to execute tail command, stopping module..."); } if (!m_command) @@ -98,7 +98,7 @@ namespace modules { cmd->tail([this](string contents) { m_output = contents; }); } catch (const std::exception& err) { m_log.err("%s: %s", name(), err.what()); - throw module_error(name() + ": Failed to execute command, stopping module..."); + throw module_error("Failed to execute command, stopping module..."); } if (m_output == m_prev) diff --git a/include/modules/volume.hpp b/include/modules/volume.hpp index 4fce553e..16978774 100644 --- a/include/modules/volume.hpp +++ b/include/modules/volume.hpp @@ -31,19 +31,17 @@ namespace modules { GET_CONFIG_VALUE(name(), m_headphoneid, "headphone-id"); if (!headphone_mixer.empty() && m_headphoneid == -1) - throw module_error( - "volume_module: Missing required property value for \"headphone-id\"..."); + throw module_error("Missing required property value for \"headphone-id\"..."); else if (headphone_mixer.empty() && m_headphoneid != -1) - throw module_error( - "volume_module: Missing required property value for \"headphone-mixer\"..."); + throw module_error("Missing required property value for \"headphone-mixer\"..."); if (string_util::lower(speaker_mixer) == "master") throw module_error( - "volume_module: The \"Master\" mixer is already processed internally. Specify another " + "The \"Master\" mixer is already processed internally. Specify another " "mixer or comment out the \"speaker-mixer\" parameter..."); if (string_util::lower(headphone_mixer) == "master") throw module_error( - "volume_module: The \"Master\" mixer is already processed internally. Specify another " + "The \"Master\" mixer is already processed internally. Specify another " "mixer or comment out the \"headphone-mixer\" parameter..."); // }}}