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_cloaking.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_cloaking.cpp') diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index f52c3bc54..03d4a9db2 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -469,7 +469,7 @@ class ModuleCloaking final { auto tags = ServerInstance->Config->ConfTags("cloak"); if (tags.empty()) - throw ModuleException("You have loaded the cloaking module but not configured any tags!"); + throw ModuleException(this, "You have loaded the cloaking module but not configured any tags!"); bool firstcloak = true; std::vector newcloaks; @@ -478,11 +478,11 @@ class ModuleCloaking final // Ensure that we have the parameter. const std::string key = tag->getString("key"); if (key.empty()) - throw ModuleException("You have not defined a cloaking key. Define as a " + ConvToStr(minkeylen) + "+ character network-wide secret, at " + tag->source.str()); + throw ModuleException(this, "You have not defined a cloaking key. Define as a " + ConvToStr(minkeylen) + "+ character network-wide secret, at " + tag->source.str()); // If we are the first cloak method then mandate a strong key. if (firstcloak && key.length() < minkeylen) - throw ModuleException("Your cloaking key is not secure. It should be at least " + ConvToStr(minkeylen) + " characters long, at " + tag->source.str()); + throw ModuleException(this, "Your cloaking key is not secure. It should be at least " + ConvToStr(minkeylen) + " characters long, at " + tag->source.str()); firstcloak = false; const bool ignorecase = tag->getBool("ignorecase"); @@ -497,7 +497,7 @@ class ModuleCloaking final else if (stdalgo::string::equalsci(mode, "full")) newcloaks.emplace_back(MODE_OPAQUE, key, prefix, suffix, ignorecase); else - throw ModuleException(mode + " is an invalid value for ; acceptable values are 'half' and 'full', at " + tag->source.str()); + throw ModuleException(this, mode + " is an invalid value for ; acceptable values are 'half' and 'full', at " + tag->source.str()); } // The cloak configuration was valid so we can apply it. -- cgit v1.3.1-10-gc9f91