summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-10-29 12:27:05 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-10-29 12:27:05 +0100
commit621c0d15963cac3519b4dce7b14fbf63c7d2761b (patch)
treef7951b4229bf4995e78697a7a423b22eb46dcd1c /pdf-over-gui/src/main
parenteb101afe6ae2e8ce4eea05cdd35f8362d960401d (diff)
downloadpdf-over-621c0d15963cac3519b4dce7b14fbf63c7d2761b.tar.gz
pdf-over-621c0d15963cac3519b4dce7b14fbf63c7d2761b.tar.bz2
pdf-over-621c0d15963cac3519b4dce7b14fbf63c7d2761b.zip
Mobile BKU error handling improved
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java9
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java4
2 files changed, 11 insertions, 2 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
index be7464fc..1a796565 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
@@ -75,6 +75,15 @@ public class ATrustHandler extends MobileBKUHandler {
public void handleSLRequestResponse(String responseData) throws Exception {
ATrustStatus status = getStatus();
+ if (responseData.contains("<sl:ErrorResponse")) { //$NON-NLS-1$
+ String errorCode = MobileBKUHelper.extractTag(responseData,
+ "<sl:ErrorCode>", "</sl:ErrorCode>"); //$NON-NLS-1$ //$NON-NLS-2$
+ String errorMsg = MobileBKUHelper.extractTag(responseData,
+ "<sl:Info>", "</sl:Info>"); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new Exception("Error from mobile BKU: " + //$NON-NLS-1$
+ errorCode + " - " + errorMsg); //$NON-NLS-1$
+ }
+
// Extract infos:
String sessionID = MobileBKUHelper.extractTag(responseData,
"identification.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java
index 5e96366f..05746c7c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java
@@ -69,10 +69,10 @@ public class MobileBKUHelper {
return data.substring(startidx, endidx);
}
log.error("extracting Tag: end tag not valid!: " + start + " ... " + end); //$NON-NLS-1$//$NON-NLS-2$
- throw new Exception("end tag not available!"); //$NON-NLS-1$
+ throw new Exception("end tag not available! Mobile BKU site changed?"); //$NON-NLS-1$
}
log.error("extracting Tag: start tag not valid!: " + start + " ... " + end); //$NON-NLS-1$//$NON-NLS-2$
- throw new Exception("start tag not available!"); //$NON-NLS-1$
+ throw new Exception("start tag not available! Mobile BKU site changed?"); //$NON-NLS-1$
}
/**