mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-29 12:03:07 +02:00
Catch error when creating sync dir fails (#608)
* Catch error when creating the sync dir fails - we cant run if this is not created or present
This commit is contained in:
parent
8f71043f23
commit
100e644ae0
10
src/main.d
10
src/main.d
|
@ -268,7 +268,15 @@ int main(string[] args)
|
||||||
log.vlog("All operations will be performed in: ", syncDir);
|
log.vlog("All operations will be performed in: ", syncDir);
|
||||||
if (!exists(syncDir)) {
|
if (!exists(syncDir)) {
|
||||||
log.vdebug("syncDir: Configured syncDir is missing. Creating: ", syncDir);
|
log.vdebug("syncDir: Configured syncDir is missing. Creating: ", syncDir);
|
||||||
mkdirRecurse(syncDir);
|
try {
|
||||||
|
// Attempt to create the sync dir we have been configured with
|
||||||
|
mkdirRecurse(syncDir);
|
||||||
|
} catch (std.file.FileException e) {
|
||||||
|
// Creating the sync directory failed
|
||||||
|
log.error("ERROR: Unable to create local OneDrive syncDir - ", e.msg);
|
||||||
|
oneDrive.http.shutdown();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
chdir(syncDir);
|
chdir(syncDir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue