ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wascally Wabbit <>
Subject RE: Ant 1.6.1 Converting Errors To Exceptions...Good|Bad?
Date Fri, 20 Feb 2004 04:27:24 GMT
At 05:26 AM 2/19/2004, you wrote:
> > From: Wascally Wabbit []
> >
> > Ant Developers,
> >
> > I've come across (ok stumbled across) an implementation
> > detail of the new Ant 1.6.1 "keepGoing" mode. The way the
> > code is currently written Ant keeps going even if an Error
> > (not an Exception) occurs. This strikes me as very risky
> > as it violates the expected response of the runtime to an
> > Error.
>There is no such thing as an expected behaviour. Whether one's
>code should catch Errors or not depends on what the application
>is trying to accomplish. Errors are usually considered things
>programmers do not have to deal with, but that does not mean they
>are not ALLOWED to deal with them.

Yes, but Ant basically pretends they did not occur. It does
not try to "deal" with anything. In my situation the error was
an out-of-memory issue. There are some environment issues that
Ant tries to handle (ClassLoader stuff, etc.) FINE. But there's
a fundamental reason why some problems are classified as errors
and not exceptions. Just my 2cents.

> > The code could be easily switched to capture all
> > Exceptions instead of Throwables. Moreover, when it does
> > capture an error, Ant effectively masks the serious Error
> > with a generic BuildException (which it really isn't). Unless
> > you run Ant in debug mode you'd never actually see the root
> > cause (in the BuildException's stack dump).
> >
>If the BuildException stack trace does not print the stack
>trace of the nested exception (if any), well that is a bug
>in the code for BuildException. We should call recursively and
>print the nested exception stack trace. I agree with you on that.

The stack trace does output the enclosed exception. BUT the
stack trace is not displayed normally; only the message.
There's no problem with the BuildException class per se.

> > Is this a bug or a "working as designed" feature of Ant?
> >
>As per my discussion on a different thread, this to me is a feature
>that should be used not only for keepGoing but on the normal
>treatment of exceptions thrown by <tasks>.

Exceptions fine. With Errors I think Ant should select the
ones that Ant knows hows to deal with; others it should let pass
(or at least not pretend like nothing happened).

>Jose Alberto

The Wabbit 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message