From 621c0d15963cac3519b4dce7b14fbf63c7d2761b Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Thu, 29 Oct 2015 12:27:05 +0100 Subject: Mobile BKU error handling improved --- .../main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 9 +++++++++ .../java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'pdf-over-gui') 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("", ""); //$NON-NLS-1$ //$NON-NLS-2$ + String errorMsg = MobileBKUHelper.extractTag(responseData, + "", ""); //$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$ } /** -- cgit v1.2.3