From dbe93e44775c4a274d329e152babd8330dadcbf8 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 16 Dec 2006 21:40:06 +0000 Subject: Add stuff so that the core catches CoreException properly git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6017 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 34f4a6201..68e2c8f96 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -262,9 +262,9 @@ void InspSocket::Close() { Instance->Config->GetIOHook(this)->OnRawSocketClose(this->fd); } - catch (ModuleException& modexcept) + catch (CoreException& modexcept) { - Instance->Log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); + Instance->Log(DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } } this->OnClose(); @@ -293,9 +293,9 @@ char* InspSocket::Read() { MOD_RESULT = Instance->Config->GetIOHook(this)->OnRawSocketRead(this->fd,this->ibuf,sizeof(this->ibuf),result2); } - catch (ModuleException& modexcept) + catch (CoreException& modexcept) { - Instance->Log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); + Instance->Log(DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } if (MOD_RESULT < 0) { @@ -397,9 +397,9 @@ bool InspSocket::FlushWriteBuffer() return true; } } - catch (ModuleException& modexcept) + catch (CoreException& modexcept) { - Instance->Log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); + Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); return true; } } @@ -517,9 +517,9 @@ bool InspSocket::Poll() { Instance->Config->GetIOHook(this)->OnRawSocketConnect(this->fd); } - catch (ModuleException& modexcept) + catch (CoreException& modexcept) { - Instance->Log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); + Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } } return this->OnConnected(); @@ -544,9 +544,9 @@ bool InspSocket::Poll() Instance->Config->GetIOHook(this)->OnRawSocketAccept(incoming, insp_ntoa(client.sin_addr), this->port); #endif } - catch (ModuleException& modexcept) + catch (CoreException& modexcept) { - Instance->Log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); + Instance->Log(DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } } @@ -637,7 +637,6 @@ void InspSocket::HandleEvent(EventType et, int errornum) } else { - Instance->Log(DEBUG,"State=%d CONNECTED=%d", this->state, I_CONNECTED); if (this->FlushWriteBuffer()) { this->Instance->SE->DelFd(this); -- cgit v1.3.1-10-gc9f91