diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-19 15:09:24 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-19 15:09:24 +0000 |
commit | fe96061b003b7064b3e17c468a8851784890f7b8 (patch) | |
tree | 73b0795ff52ceda3e3cf028abd4548ecdb3cf33e /src/modules/m_helpop.cpp | |
parent | 65d4c9a057d58c4e2e86028fbbf103a7f8d625e5 (diff) |
More exception throwing in constructors
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3245 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r-- | src/modules/m_helpop.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 9af6d6dc4..3272b3580 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -160,6 +160,15 @@ void sendtohelpop(userrec *src, int pcnt, char **params) Srv->SendToModeMask("oh",WM_AND,line); } +class HelpopException +{ + private: + std::string err; + public: + HelpopException(std::string message) : err(message) { } + virtual char* GetReason() { return (char*)err.c_str(); } +}; + class ModuleHelpop : public Module { private: @@ -192,8 +201,8 @@ class ModuleHelpop : public Module if (h_file == "") { helpop = NULL; - log(DEFAULT,"m_helpop: Helpop file not Specified."); - return; + HelpopException e("Missing helpop file"); + throw(e); } helpop = new ConfigReader(h_file); @@ -201,8 +210,8 @@ class ModuleHelpop : public Module (helpop->ReadValue("nohelpo", "line1", 0) == "") || (helpop->ReadValue("start", "line1", 0) == "")) { - log(DEFAULT,"m_helpop: Helpop file is missing important entries. Please check the example conf."); - return; + HelpopException e("m_helpop: Helpop file is missing important entries. Please check the example conf."); + throw(e); } } |