1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

various changes

This commit is contained in:
Laurent Cozic
2017-07-12 23:32:08 +01:00
parent 74e112fef9
commit d92f1c7eba
9 changed files with 62 additions and 26 deletions

View File

@ -69,8 +69,8 @@ class OneDriveApi {
}
async appDirectory() {
let r = await this.execJson('GET', '/drive/special/approot');
return r.parentReference.path + '/' + r.name;
let r = await this.execJson('GET', '/drive/special/approot');
return r.parentReference.path + '/' + r.name;
}
authCodeUrl(redirectUri) {
@ -160,10 +160,16 @@ class OneDriveApi {
options.headers['Authorization'] = 'bearer ' + this.token();
let response = null;
if (options.target == 'string') {
response = await shim.fetch(url, options);
} else { // file
response = await shim.fetchBlob(url, options);
try {
if (options.target == 'string') {
response = await shim.fetch(url, options);
} else { // file
response = await shim.fetchBlob(url, options);
}
} catch (error) {
// TEMPORARY: To try to find where uncaught error comes from
let error = new Error('OneDrive API caught: ' + error.message);
throw error;
}
if (!response.ok) {