Browse Source

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
master
Conor MacNeill 24 years ago
parent
commit
561a6d3abf
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Execute.java

+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -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);
}
}


Loading…
Cancel
Save