diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_helpop.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_randquote.cpp | 20 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index fe3d721d4..638c1bd24 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -28,7 +28,7 @@ using namespace std; #include "modules.h" #include "helperfuncs.h" -class FilterPCREException +class FilterPCREException : public ModuleException { public: virtual char* GetReason() diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 3272b3580..b3b3d113a 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -160,7 +160,7 @@ void sendtohelpop(userrec *src, int pcnt, char **params) Srv->SendToModeMask("oh",WM_AND,line); } -class HelpopException +class HelpopException : public ModuleException { private: std::string err; diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 08de8876d..8ee07f242 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -62,6 +62,18 @@ class cmd_randquote : public command_t } }; +class RandquoteException : public ModuleException +{ + private: + std::string err; + public: + RandquoteException(std::string message) : err(message) { } + + virtual char* GetReason() + { + return (char*)err.c_str(); + } +} class ModuleRandQuote : public Module { @@ -85,15 +97,15 @@ class ModuleRandQuote : public Module if (q_file == "") { - log(DEFAULT,"m_randquote: Quotefile not specified - Please check your config."); - return; + RandquoteException e("m_randquote: Quotefile not specified - Please check your config."); + throw(e); } quotes = new FileReader(q_file); if(!quotes->Exists()) { - log(DEFAULT,"m_randquote: QuoteFile not Found!! Please check your config - module will not function."); - return; + RandquoteException e("m_randquote: QuoteFile not Found!! Please check your config - module will not function."); + throw(e); } else { |