diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-14 12:48:27 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-14 12:48:27 +0200 |
commit | 60ee69060e5e6f8f1727995f424d20bbb52dd646 (patch) | |
tree | caac8bffc97e4eead170375379a26c70b3e2cb85 /pdf-over-gui/src/main/java/at | |
parent | 1802a99548ad759c54f3ad48092ea37fc2494c81 (diff) | |
download | pdf-over-60ee69060e5e6f8f1727995f424d20bbb52dd646.tar.gz pdf-over-60ee69060e5e6f8f1727995f424d20bbb52dd646.tar.bz2 pdf-over-60ee69060e5e6f8f1727995f424d20bbb52dd646.zip |
cleanup exception handling in credential handler
(also update to new a-trust html, cf. #101)
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 19 |
1 files changed, 15 insertions, 4 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 96530cf0..c9bda35f 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 @@ -282,11 +282,22 @@ public class ATrustHandler extends MobileBKUHandler { state.clearRememberedCredentials();
// extract error text!
try {
- String errorMessage = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "class", "ErrorClass");
- status.errorMessage = errorMessage;
+ String errorMessage = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "id", "Label1");
+ if (errorMessage.startsWith("Fehler: "))
+ errorMessage = errorMessage.substring(8);
+ status.errorMessage = errorMessage.strip();
} catch (Exception e) {
- throw new SignatureException(MobileBKUHelper.extractSubstring(responseData, "<sl:ErrorCode>", "</sl:ErrorCode>") + ": " +
- MobileBKUHelper.extractSubstring(responseData, "<sl:Info>", "</sl:Info>"));
+ log.error("Failed to get credentials error message", e);
+ String msg = null;
+ try
+ {
+ msg = MobileBKUHelper.extractSubstring(responseData, "<sl:ErrorCode>", "</sl:ErrorCode>") + ": " +
+ MobileBKUHelper.extractSubstring(responseData, "<sl:Info>", "</sl:Info>");
+ } catch (Exception e2) {
+ log.error("Failed to get credentials error code", e2);
+ msg = Messages.getString("error.Unexpected");
+ }
+ status.errorMessage = msg.strip();
}
}
|