ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From be...@netscape.com (Patrick Beard)
Subject [PATCH] Fix to Main.main()'s error message reporting.
Date Sat, 23 Sep 2000 18:37:17 GMT
Under JShell, when a tool calls System.exit(), it gets a ThreadDeath 
exception. These exceptions never have a non-null message, so the 
code in Main.main() always prints "null" at the end. Here's a patch 
to fix that.

Index: jakarta-ant/src/main/org/apache/tools/ant/Main.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
retrieving revision 1.20
diff -c -2 -r1.20 Main.java
*** jakarta-ant/src/main/org/apache/tools/ant/Main.java	2000/09/19 
09:09:23	1.20
--- jakarta-ant/src/main/org/apache/tools/ant/Main.java	2000/09/23 18:34:08
***************
*** 132,136 ****
           }
           catch(Throwable exc) {
!             System.err.println(exc.getMessage());
               System.exit(1);
           }
--- 132,138 ----
           }
           catch(Throwable exc) {
!         	String message = exc.getMessage();
!         	if (message != null)
!                 System.err.println(message);
               System.exit(1);
           }
-- 

// Patrick C. Beard
// Java Runtime Enthusiast -- "Will invoke interfaces for food."
// mailto:beard@netscape.com

Mime
View raw message