Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6281/src/main/org/openorb/orb/iiop
Modified Files:
IIOPTransport.java
Log Message:
changed logging so that errors are only logged if there is a real problem.
also avoid the "log and rethrow" idiom, as it leads to duplicate log entries
Index: IIOPTransport.java
===================================================================
RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/IIOPTransport.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- IIOPTransport.java 12 Aug 2004 12:54:24 -0000 1.17
+++ IIOPTransport.java 17 Nov 2004 15:26:08 -0000 1.18
@@ -252,7 +252,7 @@
// wait for EOF from other end.
if ( m_message_error || m_minor_version == 2 || m_host == null )
{
- // read and discard any extra incomming messages.
+ // read and discard any extra incoming messages.
Object recv;
do
{
@@ -268,7 +268,10 @@
}
catch ( EOFException ex )
{
- getLogger().warn( "An EOFException occured during recvMessage()!", ex );
+ // communication partner has closed socket
+ // this is expected behaviour during close(), so don't log errors here!
+ getLogger().debug( "An EOFException occured during recvMessage() "
+ + "while closing connection!", ex );
}
}
@@ -566,10 +569,6 @@
}
catch ( final IOException ex )
{
- if ( getLogger().isErrorEnabled() )
- {
- getLogger().error( "IOException while reading from input stream.", ex );
- }
throw ExceptionTool.initCause( new COMM_FAILURE(
"IOException while reading from input stream (" + ex + ")",
IIOPMinorCodes.COMM_FAILURE_IO_EXCEPTION,
@@ -577,10 +576,6 @@
}
// m == -1 so the end of the stream has been reached
- if ( getLogger().isErrorEnabled() )
- {
- getLogger().error( "The end of the stream has been reached, no bytes available!" );
- }
throw new EOFException( "The end of the stream has been reached, no bytes available!" );
}
@@ -676,13 +671,10 @@
}
catch ( IOException ex )
{
- if ( getLogger().isErrorEnabled() )
- {
- getLogger().error( "IOException while reading from input stream.", ex );
- }
- throw new org.omg.CORBA.COMM_FAILURE( "IOException while reading from input stream",
+ throw ExceptionTool.initCause( new org.omg.CORBA.COMM_FAILURE(
+ "IOException while reading from input stream",
IIOPMinorCodes.COMM_FAILURE_IO_EXCEPTION,
- org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE );
+ org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE ), ex );
}
}
@@ -702,8 +694,6 @@
}
catch ( final EOFException ex )
{
- getLogger().error( "Unexpected end of stream.", ex );
-
throw ExceptionTool.initCause( new COMM_FAILURE(
"Unexpected end of stream (" + ex + ")",
IIOPMinorCodes.COMM_FAILURE_EOF,
@@ -711,10 +701,6 @@
}
catch ( IOException ex )
{
- if ( getLogger().isErrorEnabled() )
- {
- getLogger().error( "IOException while reading from input stream.", ex );
- }
throw ExceptionTool.initCause( new COMM_FAILURE(
"IOException while reading from input stream (" + ex + ")",
IIOPMinorCodes.COMM_FAILURE_IO_EXCEPTION,
|