aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_helpop.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-07 17:12:42 +0000
committerGravatar Sadie Powell2022-01-07 17:16:50 +0000
commit52cc8a418307ae7a551d23e6bd2d367b544e7bf9 (patch)
tree9fff020964190f33174e78ff6201381be577d0b3 /src/modules/m_helpop.cpp
parentMerge branch 'insp3' into master. (diff)
Refactor CoreException and ModuleException.
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r--src/modules/m_helpop.cpp10
1 files changed, 5 insertions, 5 deletions
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("<helpop:key> is empty at %s", tag->source.str().c_str()));
+ throw ModuleException(this, InspIRCd::Format("<helpop:key> is empty at %s", tag->source.str().c_str()));
else if (irc::equals(key, "index"))
- throw ModuleException(InspIRCd::Format("<helpop:key> is set to \"index\" which is reserved at %s", tag->source.str().c_str()));
+ throw ModuleException(this, InspIRCd::Format("<helpop:key> 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("<helpop:value> is empty at %s", tag->source.str().c_str()));
+ throw ModuleException(this, InspIRCd::Format("<helpop:value> 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("<helpop> tag with duplicate key '%s' at %s",
+ throw ModuleException(this, InspIRCd::Format("<helpop> tag with duplicate key '%s' at %s",
key.c_str(), tag->source.str().c_str()));
}
}