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_helpop.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_helpop.cpp') diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 4ad952479..0984ac91c 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -115,23 +115,23 @@ class ModuleHelpop final HelpMap newhelp; auto tags = ServerInstance->Config->ConfTags("helpop"); if (tags.empty()) - throw ModuleException("You have loaded the helpop module but not configured any help topics!"); + throw ModuleException(this, "You have loaded the helpop module but not configured any help topics!"); for (const auto& [_, tag] : tags) { // Attempt to read the help key. const std::string key = tag->getString("key"); if (key.empty()) - throw ModuleException(InspIRCd::Format(" is empty at %s", tag->source.str().c_str())); + throw ModuleException(this, InspIRCd::Format(" is empty at %s", tag->source.str().c_str())); else if (irc::equals(key, "index")) - throw ModuleException(InspIRCd::Format(" is set to \"index\" which is reserved at %s", tag->source.str().c_str())); + throw ModuleException(this, InspIRCd::Format(" is set to \"index\" which is reserved at %s", tag->source.str().c_str())); else if (key.length() > longestkey) longestkey = key.length(); // Attempt to read the help value. std::string value; if (!tag->readString("value", value, true) || value.empty()) - throw ModuleException(InspIRCd::Format(" is empty at %s", tag->source.str().c_str())); + throw ModuleException(this, InspIRCd::Format(" is empty at %s", tag->source.str().c_str())); // Parse the help body. Empty lines are replaced with a single // space because some clients are unable to show blank lines. @@ -144,7 +144,7 @@ class ModuleHelpop final const std::string title = tag->getString("title", InspIRCd::Format("*** Help for %s", key.c_str()), 1); if (!newhelp.emplace(key, HelpTopic(helpmsg, title)).second) { - throw ModuleException(InspIRCd::Format(" tag with duplicate key '%s' at %s", + throw ModuleException(this, InspIRCd::Format(" tag with duplicate key '%s' at %s", key.c_str(), tag->source.str().c_str())); } } -- cgit v1.3.1-10-gc9f91