- if(t != null && t instanceof RuntimeException && ! "Widget is disposed".equals(t.getMessage())){
- MessagingUtils.errorDialog("Unexpected error",
- null,
- MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
- statusAdapter.getStatus().getPlugin(),
- t,
- true);
- }
+ if(t != null &&
+ t instanceof RuntimeException &&
+ ! "Widget is disposed".equals(t.getMessage()) &&
+ ! handleKnownRuntimeException(t,statusAdapter.getStatus().getPlugin())) {
+
+ MessagingUtils.errorDialog("Unexpected error",
+ null,
+ MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
+ statusAdapter.getStatus().getPlugin(),
+ t,
+ true);
+
+ }
+ }
+ }
+
+ private boolean handleKnownRuntimeException(Throwable t, String pluginId) {
+ if(t instanceof RemoteConnectFailureException ||
+ t.getCause() instanceof RemoteConnectFailureException) {
+ MessagingUtils.errorDialog("Connection Failure",
+ null,
+ MessagingUtils.CONNECTION_FAILURE_MESSAGE + System.getProperty("line.separator"),
+ pluginId,
+ t,
+ true,
+ false);
+ return true;
+ }
+ if(t instanceof RemoteAccessException ||
+ t.getCause() instanceof RemoteAccessException) {
+ MessagingUtils.errorDialog("Remote Access Error",
+ null,
+ MessagingUtils.REMOTE_ACCESS_FAILURE_MESSAGE + System.getProperty("line.separator"),
+ pluginId,
+ t,
+ true,
+ false);
+ return true;