import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.internal.Workbench;
+import org.springframework.remoting.RemoteAccessException;
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.MementoHelper;
}
/**
* <p>notifyContextStart</p>
+ * @throws Throwable
*/
- public void notifyContextStart() {
+ public void notifyContextStart() throws RemoteAccessException {
MessagingUtils.info("Notifying context listeners, that the context has started.");
ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
}
});
} catch (InvocationTargetException e) {
- MessagingUtils.error(getClass(), e);
+ if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
+ if (e.getTargetException().getMessage().contains("403")){
+ // new CdmAuthenticationException("Access Denied", e.getTargetException());
+ throw new CdmAuthenticationException("You are logged in now but you are not permitted to use the TaxEditor with the selected data source", e.getTargetException());
+ }else{
+ MessagingUtils.error(getClass(), e.getTargetException());
+ }
+ }else{
+ MessagingUtils.error(getClass(), e);
+ }
} catch (InterruptedException e) {
MessagingUtils.error(getClass(), e);
}
}
});
} catch (InvocationTargetException e) {
- MessagingUtils.error(getClass(), e);
+ if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
+ if (e.getTargetException().getMessage().contains("403")){
+ MessagingUtils.confirmDialog("Access denied", "Access denied");
+ }else{
+ MessagingUtils.error(getClass(), e.getTargetException());
+ }
+ }else{
+ MessagingUtils.error(getClass(), e);
+ }
} catch (InterruptedException e) {
MessagingUtils.error(getClass(), e);
}