package eu.etaxonomy.taxeditor;
+import java.io.OptionalDataException;
+
import org.apache.http.NoHttpResponseException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ui.application.IWorkbenchConfigurer;
return;
}
previousT = t;
+
if (t != null && t.getCause() instanceof PermissionDeniedException){
MessagingUtils.informationDialog("Permission denied", MessagingUtils.PERMISSION_DENIED);
}
t,
true);
}
- }else if (t != null && t.getStackTrace().toString().contains("java.io.OptionalDataException")){
- MessagingUtils.warn(this.getClass(), MessagingUtils.RESTART_EDITOR_MESSAGE);
+ }else {
+ if (t != null){
+ if (analyzeCauseExceptions(t)){
+ MessagingUtils.warn(this.getClass(), MessagingUtils.RESTART_EDITOR_MESSAGE);
+ }
+ }
}
}
}
- private boolean handleKnownRuntimeException(Throwable t, String pluginId) {
+ /**
+ * analyzes whether the
+ * @param t
+ * @param class1
+ */
+ private <T extends Exception> boolean analyzeCauseExceptions(Throwable t) {
+ boolean result = false;
+
+ if (t instanceof OptionalDataException || (t.getCause() != null && t.getCause() instanceof OptionalDataException)){
+ return true;
+ }else if (t.getCause() != null){
+ return analyzeCauseExceptions(t.getCause());
+ }
+ return result;
+
+
+
+// if (t instanceof OptionalDataException || (t.getCause() != null && t.getCause() instanceof OptionalDataException)){
+// return true;
+// }else if (t.getCause() != null){
+// return analyzeCauseExceptions(t.getCause());
+// }
+// return result;
+
+ }
+
+ private boolean handleKnownRuntimeException(Throwable t, String pluginId) {
if(t instanceof RemoteConnectFailureException ||
t.getCause() instanceof RemoteConnectFailureException) {
MessagingUtils.errorDialog("Connection Failure",