Update of /var/cvs/src/org/mmbase/util/externalprocess
In directory james.mmbase.org:/tmp/cvs-serv12732

Modified Files:
        CommandLauncher.java ProcessException.java 
Log Message:
Using initCause for exceptions


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util/externalprocess


Index: CommandLauncher.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/externalprocess/CommandLauncher.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- CommandLauncher.java        2 Mar 2007 21:05:15 -0000       1.9
+++ CommandLauncher.java        24 Sep 2008 05:37:50 -0000      1.10
@@ -115,14 +115,13 @@
         try {
             process = ProcessFactory.getFactory().exec(command);
         } catch (IOException e) {
-            throw new ProcessException("An I/O error occured: " + 
e.getMessage());
+            throw new ProcessException("An I/O error occured: " + 
e.getMessage(), e);
         } catch (SecurityException e) {
-            throw new ProcessException(
-                "A security manager exists and its checkExec method " + 
"doesn't allow creation of a subprocess.");
+            throw new ProcessException("A security manager exists and its 
checkExec method doesn't allow creation of a subprocess.", e);
         } catch (NullPointerException e) {
-            throw new ProcessException("Command is null.");
+            throw new ProcessException("Command is null.", e);
         } catch (IllegalArgumentException e) {
-            throw new ProcessException("Command is empty.");
+            throw new ProcessException("Command is empty.", e);
         }
     }
 
@@ -139,14 +138,13 @@
         try {
             process = ProcessFactory.getFactory().exec(commandArgs);
         } catch (IOException e) {
-            throw new ProcessException("An I/O error occured: " + 
e.getMessage());
+            throw new ProcessException("An I/O error occured: " + 
e.getMessage(), e);
         } catch (SecurityException e) {
-            throw new ProcessException(
-                "A security manager exists and its checkExec method " + 
"doesn't allow creation of a subprocess.");
+            throw new ProcessException("A security manager exists and its 
checkExec method doesn't allow creation of a subprocess.", e);
         } catch (NullPointerException e) {
-            throw new ProcessException("Command is null.");
+            throw new ProcessException("Command is null.", e);
         } catch (IllegalArgumentException e) {
-            throw new ProcessException("Command is empty.");
+            throw new ProcessException("Command is empty.", e);
         }
     }
 


Index: ProcessException.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/externalprocess/ProcessException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ProcessException.java       12 May 2003 13:10:47 -0000      1.3
+++ ProcessException.java       24 Sep 2008 05:37:50 -0000      1.4
@@ -12,7 +12,7 @@
 /** This excpetion is thrown when an external process failed.
  * 
  * @author Nico Klasens (Finalist IT Group)
- * @version $Id: ProcessException.java,v 1.3 2003/05/12 13:10:47 kees Exp $
+ * @version $Id: ProcessException.java,v 1.4 2008/09/24 05:37:50 michiel Exp $
  * @since MMBase-1.6
  */
 public class ProcessException extends Exception {
@@ -32,4 +32,22 @@
         super(message);
     }
 
+
+    /**
+     * Constructor for ProcessException.
+     * @since MMBase-1.9
+     */
+    public ProcessException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructor for ProcessException.
+     * @param message
+     * @since MMBase-1.9
+     */
+    public ProcessException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
 }
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to