tighten exception signature of utility method
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@994966 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/SigilUI.java b/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/SigilUI.java
index e2fe38f..6c52ccf 100644
--- a/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/SigilUI.java
+++ b/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/SigilUI.java
@@ -26,6 +26,7 @@
import java.util.concurrent.Callable;
import org.apache.felix.sigil.eclipse.SigilCore;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageRegistry;
@@ -123,8 +124,7 @@
}
}
- public static void runWorkspaceOperationSync(IRunnableWithProgress op, Shell shell)
- throws Throwable
+ public static void runWorkspaceOperationSync(IRunnableWithProgress op, Shell shell) throws CoreException
{
if (shell == null)
{
@@ -136,7 +136,12 @@
}
catch (InvocationTargetException e)
{
- throw e.getCause();
+ if (e.getCause() instanceof CoreException) {
+ throw (CoreException) e.getCause();
+ }
+ else {
+ throw SigilCore.newCoreException("Failed to execute task", e.getCause());
+ }
}
catch (InterruptedException e1)
{