diff options
| author | 2022-01-07 17:12:42 +0000 | |
|---|---|---|
| committer | 2022-01-07 17:16:50 +0000 | |
| commit | 52cc8a418307ae7a551d23e6bd2d367b544e7bf9 (patch) | |
| tree | 9fff020964190f33174e78ff6201381be577d0b3 /src/modules/m_dnsbl.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Refactor CoreException and ModuleException.
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<ConfigTag> tag) + DNSBLEntry(const Module* mod, std::shared_ptr<ConfigTag> tag) { name = tag->getString("name"); if (name.empty()) - throw ModuleException("<dnsbl:name> can not be empty at " + tag->source.str()); + throw ModuleException(mod, "<dnsbl:name> can not be empty at " + tag->source.str()); domain = tag->getString("domain"); if (domain.empty()) - throw ModuleException("<dnsbl:domain> can not be empty at " + tag->source.str()); + throw ModuleException(mod, "<dnsbl:domain> 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("<dnsbl:records> can only hold records between 0 and 255 at " + tag->source.str()); + throw ModuleException(mod, "<dnsbl:records> can only hold records between 0 and 255 at " + tag->source.str()); records.set(record); } } else { - throw ModuleException(typestr + " is an invalid value for <dnsbl:type>; acceptable values are 'bitmask' or 'records' at " + throw ModuleException(mod, typestr + " is an invalid value for <dnsbl:type>; 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<DNSBLEntry>(tag); + auto entry = std::make_shared<DNSBLEntry>(this, tag); newdnsbls.push_back(entry); } dnsbls.swap(newdnsbls); |
