From b98014180f2ef9f4adc7b8a1a66aa7215482f788 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 14 Jul 2022 13:32:54 +0200 Subject: add error message for failing to connect (cf. #47) --- .../main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui') 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); -- cgit v1.2.3