Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2018-01-23 16:11:43 +0000
committerPierre-Charles David2018-01-23 16:14:35 +0000
commit11513c142681c32e22dc4df8fa2f0ef600c25e0b (patch)
treedc953e47fab170db0b995da71e076cb5c32c2f15
parente3799bf2e8b1fa59dbc62126e9dfa3d6fcf6f335 (diff)
downloadorg.eclipse.sirius-11513c142681c32e22dc4df8fa2f0ef600c25e0b.tar.gz
org.eclipse.sirius-11513c142681c32e22dc4df8fa2f0ef600c25e0b.tar.xz
org.eclipse.sirius-11513c142681c32e22dc4df8fa2f0ef600c25e0b.zip
[528005] 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: 528005 Change-Id: I26b659439765e6841f95a2b6764ecc5eff98a909 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