ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Execute.java
Date Mon, 30 Jul 2001 14:07:31 GMT
conor       01/07/30 07:07:31

  Modified:    src/main/org/apache/tools/ant/taskdefs Execute.java
  Log:
  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
  
  Revision  Changes    Path
  1.19      +4 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Execute.java	2001/07/06 11:14:55	1.18
  +++ Execute.java	2001/07/30 14:07:31	1.19
  @@ -563,7 +563,7 @@
                   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 @@
                       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);
               }
           }
           
  
  
  

Mime
View raw message