From 52cc8a418307ae7a551d23e6bd2d367b544e7bf9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 7 Jan 2022 17:12:42 +0000 Subject: Refactor CoreException and ModuleException. --- src/modules/m_showfile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_showfile.cpp') diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index 3de8df9d3..cb952e127 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -108,13 +108,13 @@ class ModuleShowFile final { std::string cmdname = tag->getString("name"); if (cmdname.empty()) - throw ModuleException("Empty value for 'name'"); + throw ModuleException(this, "Empty value for 'name'"); std::transform(cmdname.begin(), cmdname.end(), cmdname.begin(), ::toupper); const std::string file = tag->getString("file", cmdname); if (file.empty()) - throw ModuleException("Empty value for 'file'"); + throw ModuleException(this, "Empty value for 'file'"); FileReader reader(file); CommandShowFile* sfcmd; @@ -123,12 +123,12 @@ class ModuleShowFile final { // Command exists, check if it is ours if (handler->creator != this) - throw ModuleException("Command " + cmdname + " already exists"); + throw ModuleException(this, "Command " + cmdname + " already exists"); // This is our command, make sure we don't have the same entry twice sfcmd = static_cast(handler); if (stdalgo::isin(newcmds, sfcmd)) - throw ModuleException("Command " + cmdname + " is already used in a tag"); + throw ModuleException(this, "Command " + cmdname + " is already used in a tag"); } else { -- cgit v1.3.1-10-gc9f91