aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/apps/Fop.java
diff options
context:
space:
mode:
authorKelly Campbell <kellyc@apache.org>2001-04-12 00:12:49 +0000
committerKelly Campbell <kellyc@apache.org>2001-04-12 00:12:49 +0000
commit2153c1606caffaf86e343090c15293adcc6f93b3 (patch)
tree650b4d751729f2ada04b5ccfb830719c76d00e6a /src/org/apache/fop/apps/Fop.java
parent9d3309e618d6fd4cde6cc648cb6209dcf1ccdbbc (diff)
downloadxmlgraphics-fop-2153c1606caffaf86e343090c15293adcc6f93b3.tar.gz
xmlgraphics-fop-2153c1606caffaf86e343090c15293adcc6f93b3.zip
Removed uses of System.out where throwing a FOPException should suffice.
Refactored code to throw FOPExceptions so embedding FOP wont' cause app server JVMs to exit. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194208 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/apps/Fop.java')
-rw-r--r--src/org/apache/fop/apps/Fop.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/org/apache/fop/apps/Fop.java b/src/org/apache/fop/apps/Fop.java
index 727fbbaf3..2f4032deb 100644
--- a/src/org/apache/fop/apps/Fop.java
+++ b/src/org/apache/fop/apps/Fop.java
@@ -7,11 +7,30 @@
package org.apache.fop.apps;
+import org.apache.fop.messaging.MessageHandler;
+
public class Fop {
public static void main (String [] args) {
- CommandLineOptions options = new CommandLineOptions (args);
- Starter starter = options.getStarter();
- starter.run();
+ CommandLineOptions options = null;
+
+ try {
+ options = new CommandLineOptions (args);
+ Starter starter = options.getStarter();
+ starter.run();
+ }
+ catch (FOPException e) {
+ MessageHandler.errorln("ERROR: "+e.getMessage());
+ if (options != null && options.isDebugMode().booleanValue()) {
+ e.printStackTrace();
+ }
+ }
+ catch (java.io.FileNotFoundException e) {
+ MessageHandler.errorln("ERROR: "+e.getMessage());
+ if (options != null && options.isDebugMode().booleanValue()) {
+ e.printStackTrace();
+ }
+ }
}
+
}