summaryrefslogtreecommitdiff
path: root/src/inspsocket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-16 21:40:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-16 21:40:06 +0000
commitdbe93e44775c4a274d329e152babd8330dadcbf8 (patch)
tree55d4bd231ecbe94f563e15e45c725acc860d4447 /src/inspsocket.cpp
parentd2bc82e04d45bcafabc430e765fdfc8eb43d558e (diff)
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
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r--src/inspsocket.cpp21
1 files changed, 10 insertions, 11 deletions
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);