Show errors if any directories could not be created. (fixes #97)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-07-11 10:51:52 -05:00
parent 05c7ac0a02
commit 4e2074e41b
2 changed files with 18 additions and 12 deletions

View File

@@ -289,11 +289,9 @@ public class Utils {
public static void takeScreenShot() {
// create the screenshot directory
File dir = Options.getScreenshotDir();
if (!dir.isDirectory()) {
if (!dir.mkdir()) {
ErrorHandler.error("Failed to create screenshot directory.", null, false);
return;
}
if (!dir.isDirectory() && !dir.mkdir()) {
ErrorHandler.error(String.format("Failed to create screenshot directory at '%s'.", dir.getAbsolutePath()), null, false);
return;
}
// create file name