Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Barbin2017-09-11 15:25:10 +0000
committerFlorian Barbin2017-09-14 13:10:07 +0000
commit2eb4fd7a04475038868466eb923e38f0ac49379f (patch)
treeaf4bef7127f835dd0f2e7539ec9ef3366cc20cce
parentea1316115f20fadc0f4a860042ef62c45c2ad6d3 (diff)
downloadorg.eclipse.sirius-2eb4fd7a04475038868466eb923e38f0ac49379f.tar.gz
org.eclipse.sirius-2eb4fd7a04475038868466eb923e38f0ac49379f.tar.xz
org.eclipse.sirius-2eb4fd7a04475038868466eb923e38f0ac49379f.zip
[519142] Display a more explicit error message in SessionEditor.
* If the session cannot be loaded (because of too recent version for instance) the error is now explicitly displayed instead of having a NPE later during the execution. Bug: 519142 Change-Id: I3c8aa6006847ee6385911fac1c75974949d7a6c2 Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/SessionEditor.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/SessionEditor.java b/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/SessionEditor.java
index f50192748e..516795d894 100644
--- a/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/SessionEditor.java
+++ b/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/SessionEditor.java
@@ -405,8 +405,16 @@ public class SessionEditor extends SharedHeaderFormEditor implements ITabbedProp
};
session.getTransactionalEditingDomain().getCommandStack().addCommandStackListener(listener);
}
- } catch (InvocationTargetException | InterruptedException e) {
+ } catch (InvocationTargetException e) {
ErrorDialog.openError(getSite().getShell(), MessageFormat.format(Messages.UI_SessionEditor_session_loading_error_message, new Object[0]), e.getMessage(), Status.CANCEL_STATUS);
+ // We cannot continue if one of those exception has been thrown ( if
+ // the Session cannot be loaded for instance). We throw a
+ // PartInitException.
+ throw new PartInitException(e.getTargetException().getMessage(), e.getTargetException());
+
+ } catch (InterruptedException e) {
+ ErrorDialog.openError(getSite().getShell(), MessageFormat.format(Messages.UI_SessionEditor_session_loading_error_message, new Object[0]), e.getMessage(), Status.CANCEL_STATUS);
+ throw new PartInitException(e.getMessage(), e);
}
pageRegistry = SessionEditorPlugin.getPlugin().getPageRegistry();
pageRegistry.addRegistryListener(this);

Back to the top