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_rline.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Refactor CoreException and ModuleException.
Diffstat (limited to 'src/modules/m_rline.cpp')
| -rw-r--r-- | src/modules/m_rline.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index e52224738..bc599147a 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -97,9 +97,15 @@ class RLine final class RLineFactory final : public XLineFactory { - public: + private: + const Module* creator; Regex::EngineReference& rxfactory; - RLineFactory(Regex::EngineReference& rx) : XLineFactory("R"), rxfactory(rx) + + public: + RLineFactory(const Module* mod, Regex::EngineReference& rx) + : XLineFactory("R") + , creator(mod) + , rxfactory(rx) { } @@ -110,7 +116,7 @@ class RLineFactory final if (!rxfactory) { ServerInstance->SNO.WriteToSnoMask('a', "Cannot create regexes until engine is set to a loaded provider!"); - throw ModuleException("Regex engine not set or loaded!"); + throw ModuleException(creator, "Regex engine not set or loaded!"); } return new RLine(set_time, duration, source, reason, xline_specific_mask, rxfactory); @@ -213,7 +219,7 @@ class ModuleRLine final : Module(VF_VENDOR | VF_COMMON, "Adds the /RLINE command which allows server operators to prevent users matching a nickname!username@hostname+realname regular expression from connecting to the server.") , Stats::EventListener(this) , rxfactory(this) - , f(rxfactory) + , f(this, rxfactory) , r(this, f) { } |
