mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-01 21:42:16 +02:00
Initial work on resolving curl timeout issue
* Initial work on curl timing out to Microsoft OneDrive. If curl times out, it potentially means that there is a break in Internet access to Microsoft OneDrive
This commit is contained in:
parent
e58c76d7da
commit
8e11c5e90b
|
@ -2,6 +2,7 @@ import std.net.curl: CurlException, HTTP;
|
|||
import std.datetime, std.exception, std.file, std.json, std.path;
|
||||
import std.stdio, std.string, std.uni, std.uri;
|
||||
import config;
|
||||
import core.stdc.stdlib;
|
||||
static import log;
|
||||
shared bool debugResponse = false;
|
||||
|
||||
|
@ -423,7 +424,15 @@ final class OneDriveApi
|
|||
content ~= data;
|
||||
return data.length;
|
||||
};
|
||||
http.perform();
|
||||
|
||||
try {
|
||||
http.perform();
|
||||
} catch (CurlTimeoutException e) {
|
||||
// Potentially Timeout was reached on handle error
|
||||
log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
JSONValue json;
|
||||
try {
|
||||
json = content.parseJSON();
|
||||
|
|
Loading…
Reference in a new issue