summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-19 15:03:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-19 15:03:11 +0000
commit65d4c9a057d58c4e2e86028fbbf103a7f8d625e5 (patch)
tree1c3fb7b4afd227304c1b2967a49616ec5e5dc5b3 /src/modules
parent12b9291384b92a072089015102ae750625ef8521 (diff)
Added FilterException and throw code
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3244 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_filter.cpp18
1 files 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 <filter file=\"\"> 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 <filter file=\"\"> definition in your config file!\n");
- log(DEFAULT,"Error, could not find <filter file=\"\"> 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 <filter file=\"\"> definition in your config file!");
- log(DEFAULT,"Error, could not find <filter file=\"\"> definition in your config file!");
- return;
+ FilterException e;
+ throw(e);
}
Srv->Log(DEFAULT,std::string("m_filter: read configuration from ")+filterfile);
}