Skip to content

Commit b234271

Browse files
author
Niall Pemberton
committed
IO-77 improve error message
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@609633 13f79535-47bb-0310-9956-ffa450edef68
1 parent ee30084 commit b234271

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,8 @@ public static void moveDirectoryToDirectory(File src, File destDir, boolean crea
17721772
destDir.mkdirs();
17731773
}
17741774
if (!destDir.exists()) {
1775-
throw new IOException("Destination directory does not exist");
1775+
throw new FileNotFoundException("Destination directory '" + destDir +
1776+
"' does not exist [createDestDir=" + createDestDir +"]");
17761777
}
17771778
if (!destDir.isDirectory()) {
17781779
throw new IOException("Destination '" + destDir + "' is not a directory");
@@ -1846,7 +1847,8 @@ public static void moveFileToDirectory(File srcFile, File destDir, boolean creat
18461847
destDir.mkdirs();
18471848
}
18481849
if (!destDir.exists()) {
1849-
throw new IOException("Destination directory does not exist");
1850+
throw new FileNotFoundException("Destination directory '" + destDir +
1851+
"' does not exist [createDestDir=" + createDestDir +"]");
18501852
}
18511853
if (!destDir.isDirectory()) {
18521854
throw new IOException("Destination '" + destDir + "' is not a directory");

0 commit comments

Comments
 (0)