From 561a6d3abf96788e9441b46dc3066524bb5d3214 Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Mon, 30 Jul 2001 14:07:31 +0000 Subject: [PATCH] Add some better error management for exec errors. By wrapping the real exception in a build exception, hopefully we'll get a stack trace PR: 2542 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269410 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Execute.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index b43da4f68..1c397d569 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -563,7 +563,7 @@ public class Execute { Object[] arguments = { cmd, env, workingDir }; return (Process)_execWithCWD.invoke(Runtime.getRuntime(), arguments); } - catch ( InvocationTargetException exc ) { + catch (InvocationTargetException exc) { Throwable realexc = exc.getTargetException(); if ( realexc instanceof ThreadDeath ) { throw (ThreadDeath)realexc; @@ -572,12 +572,12 @@ public class Execute { throw (IOException)realexc; } else { - throw new IOException(realexc.getMessage()); + throw new BuildException("Unable to execute command", realexc); } } - catch ( Exception exc ) { + catch (Exception exc) { // IllegalAccess, IllegalArgument, ClassCast - throw new IOException(exc.getMessage()); + throw new BuildException("Unable to execute command", exc); } }