mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
renamed check to checkHttpCode
This commit is contained in:
parent
60a5b799f9
commit
a732845db3
|
@ -135,7 +135,7 @@ final class OneDriveApi
|
||||||
};
|
};
|
||||||
writeln("Obtaining the url ...");
|
writeln("Obtaining the url ...");
|
||||||
http.perform();
|
http.perform();
|
||||||
check();
|
checkHttpCode();
|
||||||
http.maxRedirects = 10;
|
http.maxRedirects = 10;
|
||||||
if (downloadUrl) {
|
if (downloadUrl) {
|
||||||
// try to download the file
|
// try to download the file
|
||||||
|
@ -174,7 +174,7 @@ final class OneDriveApi
|
||||||
upload(localPath, url, http);
|
upload(localPath, url, http);
|
||||||
// remove the if-match header
|
// remove the if-match header
|
||||||
if (eTag) setAccessToken(accessToken);
|
if (eTag) setAccessToken(accessToken);
|
||||||
check();
|
checkHttpCode();
|
||||||
return parseJSON(content);
|
return parseJSON(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ final class OneDriveApi
|
||||||
return parseJSON(.post(url, postData, http));
|
return parseJSON(.post(url, postData, http));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check()
|
private void checkHttpCode()
|
||||||
{
|
{
|
||||||
if (http.statusLine.code / 100 != 2) {
|
if (http.statusLine.code / 100 != 2) {
|
||||||
throw new OneDriveException(format("HTTP request returned status code %d (%s)", http.statusLine.code, http.statusLine.reason));
|
throw new OneDriveException(format("HTTP request returned status code %d (%s)", http.statusLine.code, http.statusLine.reason));
|
||||||
|
|
Loading…
Reference in a new issue