You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-02 22:49:09 +02:00
Better handling of network errors
This commit is contained in:
@@ -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) {
|
||||
@@ -172,8 +172,7 @@ class OneDriveApi {
|
||||
if (error.message == 'Network request failed') {
|
||||
// Unfortunately the error 'Network request failed' doesn't have a type
|
||||
// or error code, so hopefully that message won't change and is not localized
|
||||
this.logger().warn('Got error below - retrying...');
|
||||
this.logger().warn(error);
|
||||
this.logger().info('Got error "Network request failed" - retrying (' + i + ')...');
|
||||
await time.sleep((i + 1) * 3);
|
||||
continue;
|
||||
} else {
|
||||
@@ -204,8 +203,8 @@ class OneDriveApi {
|
||||
// type: 'system',
|
||||
// errno: 'EAGAIN',
|
||||
// code: 'EAGAIN' }
|
||||
this.logger().warn('Got error below - retrying...');
|
||||
this.logger().warn(error);
|
||||
this.logger().info('Got error below - retrying (' + i + ')...');
|
||||
this.logger().info(error);
|
||||
await time.sleep((i + 1) * 3);
|
||||
continue;
|
||||
} else if (error.code == 'itemNotFound' && method == 'DELETE') {
|
||||
|
||||
Reference in New Issue
Block a user