Bug 2812

Summary: Build Events dont get the Exception object set?
Product: Ant Reporter: SNeelakantan_C
Component: Build ProcessAssignee: Ant Notifications List <notifications>
Severity: blocker CC: SNeelakantan_C
Priority: P3    
Version: 1.3   
Target Milestone: ---   
Hardware: Sun   
OS: other   

Description SNeelakantan_C 2001-07-25 18:22:08 UTC
Hi Anties,

I wrote a class to capture build errors that a task/target might throw by
implementing the BuildListener interface. The way I tested it out was as 

<project default="A" >
<target name="A" >
<copy file="doesnotexist.txt" tofile="doesnotexist2.txt" />
<!-- both the above files do not exist -->

and wrote a class that implemented the BuildListener interface.
Even though the copy fails and I get the message
"Could not copy file doesnotexist.txt to doesnotexist2.txt" from Ant,
the BuildEvent object passed to the taskFinished() method [ implemented
in the BuildListener interface ] returns a null with getException()
..Is this because a failed copy is _not_ an exception at all in Ant's mind
or a bug so that setException() is not called before calling taskFinished() on 
an error?

I hope I have made the problem clear.
If Ant is doing the "right" thing, let me know how I can accomplish 
this 'task' :-) ?

Comment 1 Conor MacNeill 2001-07-25 20:06:27 UTC
<copy> did not throw exceptions in 1.3 but it does in 1.4. Please try a recent 
nightly build