catch folder creation errors due to file system permissions error

* catch folder creation errors due to file system permissions error
This commit is contained in:
abraunegg 2020-11-13 07:34:52 +11:00
parent cc2b8085f5
commit ac02b768d3
2 changed files with 16 additions and 5 deletions

View file

@ -506,7 +506,13 @@ final class OneDriveApi
// Create the directory
string newPath = dirName(saveToPath);
mkdirRecurse(newPath);
try {
mkdirRecurse(newPath);
} catch (FileException e) {
// display the error message
displayFileSystemErrorMessage(e.msg);
}
// Configure the applicable permissions for the folder
newPath.setAttributes(cfg.returnRequiredDirectoryPermisions());
const(char)[] url = driveByIdUrl ~ driveId ~ "/items/" ~ id ~ "/content?AVOverride=1";

View file

@ -2423,10 +2423,15 @@ final class SyncEngine
}
if (!dryRun) {
// Create the new directory
mkdirRecurse(path);
// Configure the applicable permissions for the folder
path.setAttributes(cfg.returnRequiredDirectoryPermisions());
try {
// Create the new directory
mkdirRecurse(path);
// Configure the applicable permissions for the folder
path.setAttributes(cfg.returnRequiredDirectoryPermisions());
} catch (FileException e) {
// display the error message
displayFileSystemErrorMessage(e.msg);
}
} else {
// we dont create the directory, but we need to track that we 'faked it'
idsFaked ~= [item.driveId, item.id];