Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2018-01-24 08:45:28 +0000
committerStephane Begaudeau2018-01-26 14:58:46 +0000
commitd1dc414c4946163180c5c7c95a7473a8afe21290 (patch)
treebf8cb1102d6940e093102d5ad7e24a48dcdcd967
parent5a5a7c4e5e9b2cb7282397c199c84036e474ad3a (diff)
downloadorg.eclipse.sirius-d1dc414c4946163180c5c7c95a7473a8afe21290.tar.gz
org.eclipse.sirius-d1dc414c4946163180c5c7c95a7473a8afe21290.tar.xz
org.eclipse.sirius-d1dc414c4946163180c5c7c95a7473a8afe21290.zip
[530222] Do not propagate OperationCanceledException
They are used to request cancellation/rollback, and are not the sign of an error that should be propagated and/or logged. Bug: 530222 Change-Id: I676a5ac104213bc600af349203399c817f0e7f30 Cherry-picks: 528005 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/internal/SiriusToolServices.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/internal/SiriusToolServices.java b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/internal/SiriusToolServices.java
index a4105c3dff..59828f4ff0 100644
--- a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/internal/SiriusToolServices.java
+++ b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/internal/SiriusToolServices.java
@@ -15,6 +15,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
@@ -68,6 +69,11 @@ public class SiriusToolServices {
if (command.canExecute()) {
command.execute();
}
+ } catch (OperationCanceledException cancel) {
+ // A tool (possibly via a Java service) can request the cancellation of its execution. This is
+ // handled as a rollback by EMF Transaction, but the exception should not propagate above this
+ // point: it's a signal for requesting cancellation/rollback, which at this point is done, but
+ // not an error that the caller should be aware of.
} finally {
command.dispose();
}

Back to the top