Bug 54219 - The ANT task "org.apache.fop.tools.anttasks.Fop" never throws a build exception
Summary: The ANT task "org.apache.fop.tools.anttasks.Fop" never throws a build exception
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: all
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-28 13:01 UTC by Radu Coravu
Modified: 2012-11-28 13:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Radu Coravu 2012-11-28 13:01:02 UTC
A concrete example, the DITA OT project uses a series of ANT build files to publish DITA to PDF.

The Apache FOP task "org.apache.fop.tools.anttasks.Fop" is used for this.

If the task fails (for example the PDF is opened in another application or the XSL-FO file has severe validation problems) it should throw an ANT BuildException because there is no need to continue the entire ANT build as if nothing happened.

Instead, the method "org.apache.fop.tools.anttasks.FOPTaskStarter.render(File, File, String)" catches all exceptions and just logs them in the console.

This means that it is possible that ANT finishes with a "Build succesfull" message and in fact the PDF was not produced at all.

Maybe you should add a "failonerror" attribute to the task and have it fail by default when an error is encountered.