]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Forgot to commit this?
[user/henk/code/inspircd.git] / include / modules.h
index 600d51a4c817d118b4caa05ecce24080f51cc42a..2e0a614c58de7a0375d3a490d2bebb1130ebf12b 100644 (file)
@@ -97,7 +97,7 @@ typedef std::deque<userrec*> chanuserlist;
                { \
                        modules[_i]->x ; \
                } \
-               catch (ModuleException modexcept) \
+               catch (ModuleException& modexcept) \
                { \
                        log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
                } \
@@ -122,7 +122,7 @@ typedef std::deque<userrec*> chanuserlist;
                                                break; \
                                        } \
                                } \
-                               catch (ModuleException modexcept) \
+                               catch (ModuleException& modexcept) \
                                { \
                                        log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
                                } \
@@ -289,12 +289,15 @@ class ExtMode : public classbase
 
 class ModuleException
 {
+ private:
+       std::string err;
  public:
-       ModuleException() {};
+       ModuleException() : err("Module threw an exception") {}
+       ModuleException(std::string message) : err(message) {}
        virtual ~ModuleException() {};
        virtual char *GetReason()
        {
-               return "Module threw an exception";
+               return (char*)err.c_str();
        }
 };