Permalink
Browse files

JBVFS-156 - better error message when tempdir create fails

  • Loading branch information...
1 parent 3c842cd commit 1d292e42acbf55f9d94ff141ec5c4957888635ac @dmlloyd dmlloyd committed Apr 23, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/main/java/org/jboss/vfs/TempFileProvider.java
@@ -96,7 +96,8 @@ public TempDir createTempDir(String originalName) throws IOException {
if (f.mkdir())
return new TempDir(this, f);
}
- final IOException eo = new IOException("Could not create directory after " + RETRIES + " attempts");
+ final IOException eo = new IOException(
+ String.format("Could not create directory for original name '%s' after %d attempts", originalName, Integer.valueOf(RETRIES)));
throw eo;
}
@@ -108,7 +109,11 @@ private static File createTempDir(String prefix, String suffix, File root) throw
if (f.mkdir())
return f;
}
- final IOException eo = new IOException("Could not create directory after " + RETRIES + " attempts");
+ final IOException eo = new IOException(
+ String.format("Could not create directory for root '%s' (prefix '%s', suffix '%s') after %d attempts",
+ root,
+ prefix,
+ suffix));
throw eo;
}

0 comments on commit 1d292e4

Please sign in to comment.