aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java
diff options
context:
space:
mode:
authorThomas <>2023-01-12 14:50:17 +0100
committerThomas <>2023-01-12 14:50:17 +0100
commit061129ed699a214818e7f62e2850fbe3b8b7b0ab (patch)
treef353ff2dfa1425f505a8a26fae6c2cfa45b151d6 /pdf-as-common/src/main/java
parentbb091b59b99e5c4f0f365f7515f4b6095462b626 (diff)
downloadpdf-as-4-061129ed699a214818e7f62e2850fbe3b8b7b0ab.tar.gz
pdf-as-4-061129ed699a214818e7f62e2850fbe3b8b7b0ab.tar.bz2
pdf-as-4-061129ed699a214818e7f62e2850fbe3b8b7b0ab.zip
chore(sl): check Security-Layer error-codes to distinguish between critical and non-critical errors
Issue: #71
Diffstat (limited to 'pdf-as-common/src/main/java')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/SLPdfAsException.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/SLPdfAsException.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/SLPdfAsException.java
index a0ee44d9..e7aa6099 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/SLPdfAsException.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/SLPdfAsException.java
@@ -23,8 +23,13 @@
******************************************************************************/
package at.gv.egiz.pdfas.common.exceptions;
+import java.util.Arrays;
+import java.util.List;
+
public class SLPdfAsException extends PdfAsException {
+ private static final List<Integer> ERRORCODES_ON_INFO_LEVEL = Arrays.asList(6001);
+
/**
*
*/
@@ -47,6 +52,16 @@ public class SLPdfAsException extends PdfAsException {
return info;
}
+ /**
+ * Classify SL error between critical and non-critical types.
+ *
+ * @return <code>true</code> in case of a critical error, otherwise <code>false</code>
+ */
+ public boolean isCriticalError() {
+ return !ERRORCODES_ON_INFO_LEVEL.contains(code);
+
+ }
+
protected String localizeMessage(String msgId) {
return String.format("%d : %s", code, info);
}