Bug 2812 - Build Events dont get the Exception object set?
Summary: Build Events dont get the Exception object set?
Status: RESOLVED INVALID
Alias: None
Product: Ant
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 1.3
Hardware: Sun other
: P3 blocker (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-25 18:22 UTC by SNeelakantan_C
Modified: 2008-02-22 12:18 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 
follows:

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


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' :-) ?

-Shankar
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