diff --git a/src/net/azib/ipscan/exporters/ExporterException.java b/src/net/azib/ipscan/exporters/ExporterException.java index ea1c303b..16d104ad 100644 --- a/src/net/azib/ipscan/exporters/ExporterException.java +++ b/src/net/azib/ipscan/exporters/ExporterException.java @@ -5,15 +5,14 @@ */ package net.azib.ipscan.exporters; +import net.azib.ipscan.core.UserErrorException; + /** * Exception for throwing in case of problems in Exporters. * * @author Anton Keks */ -public class ExporterException extends IllegalArgumentException { - - static final long serialVersionUID = 746237846273847L; - +public class ExporterException extends UserErrorException { public ExporterException(String message) { super(message); } diff --git a/src/net/azib/ipscan/feeders/FeederException.java b/src/net/azib/ipscan/feeders/FeederException.java index bf8b44c2..3b89a4ea 100644 --- a/src/net/azib/ipscan/feeders/FeederException.java +++ b/src/net/azib/ipscan/feeders/FeederException.java @@ -5,22 +5,15 @@ */ package net.azib.ipscan.feeders; +import net.azib.ipscan.core.UserErrorException; + /** * Exception for throwing in case of problems with Feeders. * * @author Anton Keks */ -public class FeederException extends IllegalArgumentException { - - static final long serialVersionUID = 746237846273847L; - +public class FeederException extends UserErrorException { public FeederException(String message) { super(message); } - - public FeederException(String message, Throwable cause) { - super(message); - initCause(cause); - } - } diff --git a/src/net/azib/ipscan/fetchers/FetcherException.java b/src/net/azib/ipscan/fetchers/FetcherException.java index 1caa75ab..e4a05d8f 100644 --- a/src/net/azib/ipscan/fetchers/FetcherException.java +++ b/src/net/azib/ipscan/fetchers/FetcherException.java @@ -5,19 +5,9 @@ */ package net.azib.ipscan.fetchers; -/** - * FetcherException - * - * @author Anton Keks - */ -public class FetcherException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - public FetcherException(Throwable cause) { - super(cause); - } +import net.azib.ipscan.core.UserErrorException; +public class FetcherException extends UserErrorException { public FetcherException(String label, Throwable cause) { super(label, cause); } @@ -25,5 +15,4 @@ public class FetcherException extends RuntimeException { public FetcherException(String label) { super(label); } - } diff --git a/src/net/azib/ipscan/gui/GUI.java b/src/net/azib/ipscan/gui/GUI.java index 12edcd4c..f7d97407 100644 --- a/src/net/azib/ipscan/gui/GUI.java +++ b/src/net/azib/ipscan/gui/GUI.java @@ -58,6 +58,9 @@ public class GUI implements AutoCloseable { String localizedMessage = getLocalizedMessage(e); showMessage(e instanceof UserErrorException ? SWT.ICON_WARNING : SWT.ICON_ERROR, getLabel(e instanceof UserErrorException ? "text.userError" : "text.error"), localizedMessage); + + if (!(e instanceof UserErrorException) || e.getCause() != null) + new GoogleAnalytics().report(e); } } } @@ -70,7 +73,6 @@ public class GUI implements AutoCloseable { messageBox.setText(title); messageBox.setMessage(localizedMessage); messageBox.open(); - new GoogleAnalytics().report(localizedMessage, (Throwable) null); } @Override public void close() {