1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

All: Try to display more info when there is a Dropbox API error

This commit is contained in:
Laurent Cozic 2018-06-11 00:24:29 +01:00
parent b6619b41df
commit 0528c6e970
2 changed files with 2 additions and 2 deletions

View File

@ -198,7 +198,7 @@ class DropboxApi {
return loadResponseJson();
} catch (error) {
tryCount++;
if (error && error.code && error.code.indexOf('too_many_write_operations') >= 0) {
if (error && typeof error.code === 'string' && error.code.indexOf('too_many_write_operations') >= 0) {
this.logger().warn('too_many_write_operations ' + tryCount);
if (tryCount >= 3) {
throw error;

View File

@ -23,7 +23,7 @@ class FileApiDriverDropbox {
}
hasErrorCode_(error, errorCode) {
if (!error || !error.code) return false;
if (!error || typeof error.code !== 'string') return false;
return error.code.indexOf(errorCode) >= 0;
}