Exceptions (Was RE: [ANN] Cleaned up KomHttpServer on SM)

Russell Penney russell.penney at tincanct.com
Fri Nov 5 04:11:11 UTC 2004


Goran,
   Thanks for the comments. If you do have to handle an Exceptions down in
the bowels of your code, is it better to perhaps handle the Exception and
then signal a more general Exception so that code further up can still
detect something has gone wrong?

Russell

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of goran.krampe at bluefish.se
> Sent: Thursday, 4 November 2004 11:58 PM
> To: The general-purpose Squeak developers list
> Subject: RE: [ANN] Cleaned up KomHttpServer on SM
> 
> Hi!
> 
> "Russell Penney" <russell.penney at tincanct.com> wrote:
> > > 2. Dug deep to find a little bug in the HttpRequest parsing that dear
> > > Brent mistakenly introduced :) and fixed it. Funky enough we don't
> want
> > > exceptions down there - they are swallowed hard.
> >
> > Just to get completely of topic, why are exceptions bad "down there" and
> > what does "swallowed hard" mean?
> 
> Well, they are "bad" to get down there because it was inside a handler
> that swallowed it. Swallowed meaning that the handler simply gave the
> exception the silent treatment. :)
> 
> But the method comment tries to explan why - I haven't analyzed this in
> depth. But as it stands - if there is an exception in say the
> HttpRequest parsing it will be silently swallowed today.
> 
> > I only ask because I am playing with Exceptions and would like the
> benefit
> > of people's views and experience.
> 
> Well, the lesson here is - don't swallow exceptions. The code in
> question may have a good reason for it - but generally it pisses
> developers off to a vast extent. ;)
> 
> In this case I had to throw in self halts DEEP down in the listen loop
> and step forward in the debugger to find the place where it went wrong.
> 
> > Russell
> 
> regards, Göran






More information about the Squeak-dev mailing list