Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java')
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
index 92878457..86c756f0 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
@@ -15,7 +15,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.actions.MavenLaunchConstants;
public class LaunchingUtils {
@@ -25,15 +30,19 @@ public class LaunchingUtils {
/**
* Substitute any variable
*/
- public static String substituteVar(String s) {
+ public static String substituteVar(String s) throws CoreException {
if(s == null) {
return s;
}
try {
return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(s);
} catch(CoreException e) {
+ if(e.getStatus() != null && e.getStatus().matches(IStatus.CANCEL)) {
+ throw e;
+ }
log.error("Could not substitute variable {}.", s, e);
- return null;
+ throw new CoreException(new Status(IStatus.ERROR, MavenLaunchConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenLaunchUtils_error_could_not_substitute_variable, s), e));
}
}

Back to the top