From 2a9b0cdd30113ab4926f4b68350d619c015c89a3 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 19 Feb 2006 14:44:32 +0000 Subject: Added exception handling for module loading git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3240 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/userprocess.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/userprocess.cpp') diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 5452b8f9e..888d0572f 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -88,8 +88,15 @@ void ProcessUser(userrec* cu) if (Config->GetIOHook(cu->port)) { int result2 = 0; - int MOD_RESULT = Config->GetIOHook(cu->port)->OnRawSocketRead(cu->fd,data,65535,result2); - log(DEBUG,"Data result returned by module: %d",MOD_RESULT); + try + { + int MOD_RESULT = Config->GetIOHook(cu->port)->OnRawSocketRead(cu->fd,data,65535,result2); + log(DEBUG,"Data result returned by module: %d",MOD_RESULT); + } + catch (ModuleException modexcept) + { + log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + } if (MOD_RESULT < 0) { result = -EAGAIN; -- cgit v1.3.1-10-gc9f91