classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: Made PixelGrabber more robust


From: Roman Kennke
Subject: Re: [cp-patches] FYI: Made PixelGrabber more robust
Date: Fri, 19 Aug 2005 10:39:09 +0200

Hi Mark,

Am Donnerstag, den 18.08.2005, 22:56 +0200 schrieb Mark Wielaard:
> Hi,
> 
> On Thu, 2005-08-18 at 15:41 +0200, Roman Kennke wrote:
> >             public void run ()
> >             {
> > -             ip.startProduction (PixelGrabber.this);
> > +              try
> > +                {
> > +                  ip.startProduction (PixelGrabber.this);
> > +                }
> > +              catch (Exception ex)
> > +                {
> > +                  ex.printStackTrace();
> > +                  imageComplete(ImageConsumer.ABORTED);
> > +                }
> >             }
> >           };
> 
> Why catch Exception and not Throwable? (You will miss notifying the
> consumer when an Error is thrown).

Yeah, that's right. It's just a habit of mine to catch Exceptions and
not Throwables, but in this case it really would make sense.

>  Why print the stack trace?

Because an exception is probably not expected here and indicates an
error either in Classpath or in the user application. It would be bad to
simply swallow it. I think this is done in several cases where a Thread
is protected from beeing shot by an exception (like in the event queue).
Do you think I should remove the printStackTrace()?

/Roman






reply via email to

[Prev in Thread] Current Thread [Next in Thread]