X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=2e0a614c58de7a0375d3a490d2bebb1130ebf12b;hb=b1fcb6a770eb45174ad6daf81c325a073fccd532;hp=e1fb37621b292cea16a86d1c63931466f603d8fb;hpb=2a9b0cdd30113ab4926f4b68350d619c015c89a3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules.h b/include/modules.h index e1fb37621..2e0a614c5 100644 --- a/include/modules.h +++ b/include/modules.h @@ -97,7 +97,7 @@ typedef std::deque 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 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: - virtual 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(); } };