summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-14 13:32:54 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-14 13:32:54 +0200
commitb98014180f2ef9f4adc7b8a1a66aa7215482f788 (patch)
tree952e9aee49b510defbcb374d75d477a5327c668b
parentbf04fba3b1ff92b4288c37c474c8e4b9d4e2e342 (diff)
downloadpdf-over-b98014180f2ef9f4adc7b8a1a66aa7215482f788.tar.gz
pdf-over-b98014180f2ef9f4adc7b8a1a66aa7215482f788.tar.bz2
pdf-over-b98014180f2ef9f4adc7b8a1a66aa7215482f788.zip
add error message for failing to connect (cf. #47)
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java4
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties1
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties1
3 files changed, 6 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
index 594e46c8..aee5827f 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
@@ -16,6 +16,7 @@
package at.asit.pdfover.gui.workflow.states;
import java.io.InputStream;
+import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.Timer;
import java.util.TimerTask;
@@ -170,6 +171,9 @@ public class MobileBKUState extends State {
{
log.error("Failed to resolve hostname", e);
message = String.format(Messages.getString("error.CouldNotResolveHostname"), e.getMessage());
+ } else if (e instanceof ConnectException) {
+ log.error("Failed to connect", e);
+ message = String.format(Messages.getString("error.FailedToConnect"), e.getMessage());
} else {
message = Messages.getString("error.Unexpected");
log.error(message, e);
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
index e8724ac7..b8828cb5 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
@@ -134,6 +134,7 @@ error.CouldNotResolveHostname=Could not resolve hostname '%s'.\nAre you connecte
error.CmdLineArgs=Error parsing the command-line arguments\:
error.Details=Details
error.EnteredReferenceValue=You entered the reference value\!
+error.FailedToConnect=Failed to connect to signature server:\n%s
error.FailedToGetSignedDocument=Failed to get signed document.
error.FailedToLoadEmblem=Failed to load the signature logo
error.FailedToLoadQRCode=Failed to load the QR code
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
index 355720ab..6754f2bf 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
@@ -160,6 +160,7 @@ error.TitleFatal=Fataler Fehler
error.Unexpected=Unerwarteter Fehler
error.ATrustConnection=Verbindung zu A-Trust konnte nicht aufgebaut werden
error.CouldNotResolveHostname=Server '%s' wurde nicht gefunden.\nÜberprüfen Sie Ihre Internetverbindung.
+error.FailedToConnect=Verbindung zum Signaturserver fehlgeschlagen:\n%s
exception.InvalidEmblemFile=%s ist eine ungültige Bildmarken-Datei\!
exception.InvalidPort=%s ist ungültig\: muss eine Nummer zwischen %d und %d sein.
exception.PasswordTooLong=Eingegebenes Passwort ist zu lange\!