Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-02-22 15:00:30 -0500
committerPascal Rapicault2009-02-22 15:00:30 -0500
commit1ed2f314b1584e046c036a2382c775f9f91467a4 (patch)
tree7cb3f0e7aec10c0ecc66ca4563287a456209059a /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parent124c6ac8748779462d2ffe9c3f3121c0b198b6c7 (diff)
downloadrt.equinox.p2-1ed2f314b1584e046c036a2382c775f9f91467a4.tar.gz
rt.equinox.p2-1ed2f314b1584e046c036a2382c775f9f91467a4.tar.xz
rt.equinox.p2-1ed2f314b1584e046c036a2382c775f9f91467a4.zip
Propogate back the status and report build exception
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java27
2 files changed, 32 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
index fd0477579..06699c1a5 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
@@ -28,13 +28,14 @@ public class MirrorTask extends AbstractRepositoryTask {
application.initializeRepos(null);
List ius = prepareIUs();
if (ius == null || ius.size() == 0)
- throw new BuildException("Need to specify one or more IUs.");
+ throw new BuildException("Need to specify one or more IUs to mirror.");
application.setSourceIUs(ius);
IStatus result = application.run(null);
- if (result.matches(IStatus.ERROR))
- throw new ProvisionException(result);
+ if (result.matches(IStatus.ERROR)) {
+ throw new BuildException(TaskHelper.statusToString(result, null).toString());
+ }
} catch (ProvisionException e) {
- throw new BuildException("Error occurred while transforming repository.", e);
+ throw new BuildException(e);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java
new file mode 100644
index 000000000..7ef184e7c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.internal.repository.tools.tasks;
+
+import org.eclipse.core.runtime.IStatus;
+
+public class TaskHelper {
+ public static StringBuffer statusToString(IStatus status, StringBuffer b) {
+ IStatus[] nestedStatus = status.getChildren();
+ if (b == null)
+ b = new StringBuffer();
+ b.append(status.getMessage());
+ for (int i = 0; i < nestedStatus.length; i++) {
+ b.append('\n');
+ b.append(statusToString(nestedStatus[i], b));
+ }
+ return b;
+ }
+}

Back to the top