From 65d4c9a057d58c4e2e86028fbbf103a7f8d625e5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 19 Feb 2006 15:03:11 +0000 Subject: Added FilterException and throw code git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3244 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_filter.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 5b2826f5a..59fbed596 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -29,6 +29,14 @@ using namespace std; /* $ModDesc: An enhanced version of the unreal m_filter.so used by chatspike.net */ +class FilterException : public ModuleException +{ + virtual char* GetReason() + { + return "Could not find definition in your config file!"; + } +}; + class ModuleFilter : public Module { Server *Srv; @@ -49,9 +57,8 @@ class ModuleFilter : public Module MyConf = new ConfigReader(filterfile); if ((filterfile == "") || (!MyConf->Verify())) { - printf("Error, could not find definition in your config file!\n"); - log(DEFAULT,"Error, could not find definition in your config file!"); - return; + FilterException e; + throw(e); } Srv->Log(DEFAULT,std::string("m_filter: read configuration from ")+filterfile); } @@ -134,9 +141,8 @@ class ModuleFilter : public Module if ((filterfile == "") || (!MyConf->Verify())) { // bail if the user forgot to create a config file - printf("Error, could not find definition in your config file!"); - log(DEFAULT,"Error, could not find definition in your config file!"); - return; + FilterException e; + throw(e); } Srv->Log(DEFAULT,std::string("m_filter: read configuration from ")+filterfile); } -- cgit v1.2.3