Author: niallp
Date: Wed Sep 29 15:48:51 2010
New Revision: 1002698

URL: http://svn.apache.org/viewvc?rev=1002698&view=rev
Log:
Include 'cause' in re-thrown exceptions

Modified:
    commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java

Modified: 
commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java?rev=1002698&r1=1002697&r2=1002698&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java 
(original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java 
Wed Sep 29 15:48:51 2010
@@ -448,9 +448,9 @@ public class FileSystemUtils {
             return bytes;
             
         } catch (NumberFormatException ex) {
-            throw new IOException(
+            throw new IOExceptionWithCause(
                     "Command line '" + DF + "' did not return numeric data as 
expected " +
-                    "for path '" + path + "'- check path is valid");
+                    "for path '" + path + "'- check path is valid", ex);
         }
     }
 
@@ -515,9 +515,9 @@ public class FileSystemUtils {
             return lines;
             
         } catch (InterruptedException ex) {
-            throw new IOException(
-                    "Command line threw an InterruptedException '" + 
ex.getMessage() +
-                    "' for command " + Arrays.asList(cmdAttribs));
+            throw new IOExceptionWithCause(
+                    "Command line threw an InterruptedException " +
+                    "for command " + Arrays.asList(cmdAttribs) + " timeout=" + 
timeout, ex);
         } finally {
             IOUtils.closeQuietly(in);
             IOUtils.closeQuietly(out);


Reply via email to