I see the code now. Its dead code. At one time - when tomcat was serving
resources and the client pressed the stop button - a broken pipe exception
would be logged. But since then in other code spots - the non-logging of
broken pipe has been implemented.
-Tim
Steve Kirk wrote:
Someone please correct me if I've got this wrong, but I don't think that the
"try/catch" or "if" constructs achieve anything, so the whole code that
Steffen posted could be replaced with simply:
serveResource(request, response, true);
(Maybe this is what Steffen was implying?)
So, as I am reading it, if you add "else" instead of "// HERE", it will
change the behaviour of the code, and the IOException will only be rethrown
when the "if" expression evaluates to false (i.e. when the IOException is
not a broken pipe).
So to answer your original question Steffen, I think that either the "else"
is missing, or the whole "try/catch" and "if" clauses are redundant.
-----Original Message-----
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Friday 08 October 2004 11:45
To: Tomcat Users List
Subject: Re: DefaultServlet
The else is implicit. The next line throws the IOException so
something else
down the chain can catch it.
-Tim
Steffen Heil wrote:
Hi
I just read the DefaultServlet code and found in
doGet(...) the following:
try {
serveResource(request, response, true);
} catch( IOException ex ) {
// we probably have this check somewhere else too.
if( ex.getMessage() != null
&& ex.getMessage().indexOf("Broken pipe") >= 0 ) {
// ignore it.
} // HERE
throw ex;
}
It seems there is a "else" missing ?
Otherwise, it is just NOT ignored the the complete catch
Statement makes no
sense.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]