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_denychans.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_denychans.cpp') diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index 30541920b..a2a64d15b 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -78,7 +78,7 @@ class ModuleDenyChannels final // Ensure that we have the parameter. const std::string name = tag->getString("name"); if (name.empty()) - throw ModuleException(" is a mandatory field, at " + tag->source.str()); + throw ModuleException(this, " is a mandatory field, at " + tag->source.str()); goodchans.push_back(name); } @@ -89,19 +89,19 @@ class ModuleDenyChannels final // Ensure that we have the parameter. const std::string name = tag->getString("name"); if (name.empty()) - throw ModuleException(" is a mandatory field, at " + tag->source.str()); + throw ModuleException(this, " is a mandatory field, at " + tag->source.str()); // Ensure that we have the parameter. const std::string reason = tag->getString("reason"); if (reason.empty()) - throw ModuleException(" is a mandatory field, at " + tag->source.str()); + throw ModuleException(this, " is a mandatory field, at " + tag->source.str()); const std::string redirect = tag->getString("redirect"); if (!redirect.empty()) { // Ensure that contains a channel name. if (!ServerInstance->Channels.IsChannel(redirect)) - throw ModuleException(" is not a valid channel name, at " + tag->source.str()); + throw ModuleException(this, " is not a valid channel name, at " + tag->source.str()); // We defer the rest of the validation of the redirect channel until we have // finished parsing all of the badchans. @@ -136,7 +136,7 @@ class ModuleDenyChannels final for (const auto& badchanredir : badchans) { if (InspIRCd::Match(badchan.redirect, badchanredir.name)) - throw ModuleException(" cannot be a blacklisted channel name"); + throw ModuleException(this, " cannot be a blacklisted channel name"); } } -- cgit v1.3.1-10-gc9f91