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_customprefix.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules/m_customprefix.cpp') diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index 52af6e846..b077ef7e9 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -61,20 +61,20 @@ class ModuleCustomPrefix final { const std::string name = tag->getString("name"); if (name.empty()) - throw ModuleException(" must be specified at " + tag->source.str()); + throw ModuleException(this, " must be specified at " + tag->source.str()); if (name.find(' ') != std::string::npos) - throw ModuleException(" must not contain spaces at " + tag->source.str()); + throw ModuleException(this, " must not contain spaces at " + tag->source.str()); if (tag->getBool("change")) { ModeHandler* mh = ServerInstance->Modes.FindMode(name, MODETYPE_CHANNEL); if (!mh) - throw ModuleException(" specified for a nonexistent mode at " + tag->source.str()); + throw ModuleException(this, " specified for a nonexistent mode at " + tag->source.str()); PrefixMode* pm = mh->IsPrefixMode(); if (!pm) - throw ModuleException(" specified for a non-prefix mode at " + tag->source.str()); + throw ModuleException(this, " specified for a non-prefix mode at " + tag->source.str()); unsigned int rank = static_cast(tag->getUInt("rank", pm->GetPrefixRank(), 0, UINT_MAX)); unsigned int setrank = static_cast(tag->getUInt("ranktoset", pm->GetLevelRequired(true), rank, UINT_MAX)); @@ -89,11 +89,11 @@ class ModuleCustomPrefix final const std::string letter = tag->getString("letter"); if (letter.length() != 1) - throw ModuleException(" must be set to a mode character at " + tag->source.str()); + throw ModuleException(this, " must be set to a mode character at " + tag->source.str()); const std::string prefix = tag->getString("prefix"); if (prefix.length() != 1) - throw ModuleException(" must be set to a mode prefix at " + tag->source.str()); + throw ModuleException(this, " must be set to a mode prefix at " + tag->source.str()); try { @@ -103,7 +103,7 @@ class ModuleCustomPrefix final } catch (ModuleException& e) { - throw ModuleException(e.GetReason() + " (while creating mode from " + tag->source.str() + ")"); + throw ModuleException(this, e.GetReason() + " (while creating mode from " + tag->source.str() + ")"); } } } -- cgit v1.3.1-10-gc9f91