mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-17 21:26:41 +02:00
Fix unhandled exception when authurl path is non-existent (#2456)
* Catch an unhandled exception when the user sets the authurl file to a location that cannot be accessed
This commit is contained in:
parent
94ccb7a6d0
commit
fb0a5f0796
|
@ -586,9 +586,19 @@ final class OneDriveApi
|
||||||
string[] authFiles = authFilesString.split(":");
|
string[] authFiles = authFilesString.split(":");
|
||||||
string authUrl = authFiles[0];
|
string authUrl = authFiles[0];
|
||||||
string responseUrl = authFiles[1];
|
string responseUrl = authFiles[1];
|
||||||
auto authUrlFile = File(authUrl, "w");
|
|
||||||
authUrlFile.write(url);
|
try {
|
||||||
authUrlFile.close();
|
// Try and write out the auth URL to the nominated file
|
||||||
|
auto authUrlFile = File(authUrl, "w");
|
||||||
|
authUrlFile.write(url);
|
||||||
|
authUrlFile.close();
|
||||||
|
} catch (std.exception.ErrnoException e) {
|
||||||
|
// There was a file system error
|
||||||
|
// display the error message
|
||||||
|
displayFileSystemErrorMessage(e.msg, getFunctionName!({}));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
while (!exists(responseUrl)) {
|
while (!exists(responseUrl)) {
|
||||||
Thread.sleep(dur!("msecs")(100));
|
Thread.sleep(dur!("msecs")(100));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue