aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-cli/src/main/java/at/gv
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-15 18:07:20 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-15 18:07:20 +0200
commit0b663afa4d0167df1e838e1f37bb5862e8951037 (patch)
tree1b962dedd3c2e1eba042c89fbf6191b42218bd36 /pdf-as-cli/src/main/java/at/gv
parentd9dcd54eae2b3a8e46dce69c96eca7c97f1be429 (diff)
downloadpdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.tar.gz
pdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.tar.bz2
pdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.zip
PDF-AS Errorhandling redesign only PDFASError Exceptions are returned
!
Diffstat (limited to 'pdf-as-cli/src/main/java/at/gv')
-rw-r--r--pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
index 222fd33a..3ce215c8 100644
--- a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
+++ b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
@@ -41,6 +41,7 @@ import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.io.IOUtils;
+import at.gv.egiz.pdfas.common.exceptions.PDFASError;
import at.gv.egiz.pdfas.common.utils.StreamUtils;
import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource;
import at.gv.egiz.pdfas.lib.api.Configuration;
@@ -241,8 +242,12 @@ public class Main {
System.err.println("Invalid arguments: " + e.getMessage());
usage();
System.exit(-1);
- } catch (Exception e) {
- System.err.println("PDF-AS Error: " + e.getMessage());
+ } catch (PDFASError e) {
+ System.err.println("PDF-AS Error: [" + e.getCode() + "]" + e.getMessage());
+ e.printStackTrace(System.err);
+ System.exit(-1);
+ } catch (Throwable e) {
+ System.err.println("Unhandled PDF-AS Error: " + e.getMessage());
e.printStackTrace(System.err);
System.exit(-1);
}