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_dnsbl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/modules/m_dnsbl.cpp') diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 6c9e56a2a..db9c2ed01 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -103,15 +103,15 @@ public: // If action is set to gline, kline, or zline then the duration for an X-line to last for. unsigned long xlineduration; - DNSBLEntry(std::shared_ptr tag) + DNSBLEntry(const Module* mod, std::shared_ptr tag) { name = tag->getString("name"); if (name.empty()) - throw ModuleException(" can not be empty at " + tag->source.str()); + throw ModuleException(mod, " can not be empty at " + tag->source.str()); domain = tag->getString("domain"); if (domain.empty()) - throw ModuleException(" can not be empty at " + tag->source.str()); + throw ModuleException(mod, " can not be empty at " + tag->source.str()); action = tag->getEnum("action", Action::KILL, { { "gline", Action::GLINE }, @@ -137,14 +137,14 @@ public: for (long record = 0; (record = recordrange.GetToken()); ) { if (record < 0 || record > UCHAR_MAX) - throw ModuleException(" can only hold records between 0 and 255 at " + tag->source.str()); + throw ModuleException(mod, " can only hold records between 0 and 255 at " + tag->source.str()); records.set(record); } } else { - throw ModuleException(typestr + " is an invalid value for ; acceptable values are 'bitmask' or 'records' at " + throw ModuleException(mod, typestr + " is an invalid value for ; acceptable values are 'bitmask' or 'records' at " + tag->source.str()); } @@ -387,7 +387,7 @@ class ModuleDNSBL final DNSBLEntries newdnsbls; for (const auto& [_, tag] : ServerInstance->Config->ConfTags("dnsbl")) { - auto entry = std::make_shared(tag); + auto entry = std::make_shared(this, tag); newdnsbls.push_back(entry); } dnsbls.swap(newdnsbls); -- cgit v1.3.1-10-gc9f91