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:
abraunegg 2018-07-26 09:48:05 +10:00
parent e58c76d7da
commit 8e11c5e90b

View file

@ -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();