Dan,
Thanks for sharing your pain. You should check out Jalopy on SourceForge. It
is a code formatter and code inspector. It allows you to format your java
code according to your organization's conventions and also inspect it for
some of the items in Joshua Bloch's Effective Java book. The code inspector
capability includes detecting empty catch and finally clauses. There are
integrations with several IDE's and Ant. We use Jalopy to format and catch
bad programming practices and integrate it as part of the build process.

Regards,

Richard


-----Original Message-----
From: Dan Allen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 10:46 AM
To: Struts Users Mailing List
Subject: never, ever bury an exception!


I know that this might be obvious, but I am telling you all just so that you
can learn from my pain.  Because of time pressure, I accidently left an
caught exception in the following state:

catch (Exception e)
{
  // TODO: do something with me
}

For the last couple of days the application server has been coming crashing
down.  The problem was that this particular exception was being thrown as
the result of a StackOverflow error.  When the exception was silenced, the
execution would go back around and throw the StackOverflow error again
inside a loop.  Eventually, memory would become expended and the app server
would die.  But because the error is totally silenced, no reason is given
for the crash because the app server didn't receive any messages.

At the very, very least, log the error.  That will give you an inkling of an
idea as to where the server might be dying.  Even if there is no way you
think that the code you wrote would lead to a StackOverflow (or some other
accumulating problem), do it anyway.  Point is, you are better safe then
sorry.  I am an idiot for leaving that exception in that state, but at least
I learned my lesson.

Dan

-- 
Open Source Advocacy
http://www.mojavelinux.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to