Skip to content

Commit 0e7c3a8

Browse files
author
Niall Pemberton
committed
Include 'cause' in re-thrown exceptions
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1002698 13f79535-47bb-0310-9956-ffa450edef68
1 parent ab42367 commit 0e7c3a8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/java/org/apache/commons/io/FileSystemUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,9 @@ long parseBytes(String freeSpace, String path) throws IOException {
448448
return bytes;
449449

450450
} catch (NumberFormatException ex) {
451-
throw new IOException(
451+
throw new IOExceptionWithCause(
452452
"Command line '" + DF + "' did not return numeric data as expected " +
453-
"for path '" + path + "'- check path is valid");
453+
"for path '" + path + "'- check path is valid", ex);
454454
}
455455
}
456456

@@ -515,9 +515,9 @@ List<String> performCommand(String[] cmdAttribs, int max, long timeout) throws I
515515
return lines;
516516

517517
} catch (InterruptedException ex) {
518-
throw new IOException(
519-
"Command line threw an InterruptedException '" + ex.getMessage() +
520-
"' for command " + Arrays.asList(cmdAttribs));
518+
throw new IOExceptionWithCause(
519+
"Command line threw an InterruptedException " +
520+
"for command " + Arrays.asList(cmdAttribs) + " timeout=" + timeout, ex);
521521
} finally {
522522
IOUtils.closeQuietly(in);
523523
IOUtils.closeQuietly(out);

0 commit comments

Comments
 (0)