From 9bed7c364ba16fe1dbacf38dc6046c652f04bccc Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Thu, 26 Jan 2017 22:26:17 +0200 Subject: [PATCH] catch only Exceptions here, leaving Errors to a more outer handler --- src/net/azib/ipscan/Main.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/azib/ipscan/Main.java b/src/net/azib/ipscan/Main.java index 72857582..3eb630ca 100644 --- a/src/net/azib/ipscan/Main.java +++ b/src/net/azib/ipscan/Main.java @@ -74,9 +74,9 @@ public class Main { if (!display.readAndDispatch()) display.sleep(); } - catch (Throwable e) { - if (e instanceof SWTException && e.getCause() != null) - e = e.getCause(); + catch (Exception e) { + if (e instanceof SWTException && e.getCause() instanceof Exception) + e = (Exception) e.getCause(); // display a nice error message String localizedMessage = getLocalizedMessage(e);