aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/commandline/Main.java12
-rw-r--r--src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java1
2 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/commandline/Main.java b/src/main/java/at/gv/egiz/pdfas/commandline/Main.java
index ec75d34..a910ebf 100644
--- a/src/main/java/at/gv/egiz/pdfas/commandline/Main.java
+++ b/src/main/java/at/gv/egiz/pdfas/commandline/Main.java
@@ -523,12 +523,14 @@ public abstract class Main
if (output != null)
{
- logger_.debug("Deleting output file on error.");
File oFile = new File(output);
- boolean deleted = oFile.delete();
- if (!deleted)
- {
- logger_.error("Couldn't delete output file " + output);
+ if (oFile.exists()) {
+ logger_.debug("Deleting output file on error.");
+ boolean deleted = oFile.delete();
+ if (!deleted)
+ {
+ logger_.error("Couldn't delete output file " + output);
+ }
}
}
}
diff --git a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
index 64d1470..79f17aa 100644
--- a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
+++ b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
@@ -23,6 +23,7 @@ public final class ErrorCode
public static final int KZ_SETTING_NOT_FOUND = 102;
public static final int NO_EMBEDABLE_TTF_CONFIGURED_FOR_PDFA = 103;
public static final int INVALID_SIGNATURE_LAYOUT_IMPL_CONFIGURED = 104;
+ public static final int MISSING_HEADER_SERVER_USER_AGENT = 105;
public static final int DOCUMENT_CANNOT_BE_READ = 201;
public static final int TEXT_EXTRACTION_EXCEPTION = 202;