dropbox-with-offline-refresh-token
Advanced tools
Comparing version 1.0.11 to 1.0.12
{ | ||
"name": "dropbox-with-offline-refresh-token", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "use can easily use the dropbox api without have to handle all the authentication stuff. all you need is a single offline refresh token.", | ||
@@ -5,0 +5,0 @@ "main": "target/lib/Client.js", |
@@ -71,3 +71,3 @@ import axios from "axios"; | ||
const errorMsg = e.error.error['.tag'] | ||
const errorMsg = e.error.error['.tag'] ?? e.error.error.reason['.tag'] | ||
if (typeof errorMsg !== 'string') throw e | ||
@@ -79,3 +79,2 @@ switch (errorMsg) { | ||
const retryAfter = e.error.error.retry_after ?? 1 | ||
console.log('now rerunning process!', retryAfter) | ||
return new Promise((res) => setTimeout(() => res(this.execAsync(lambda)), retryAfter)) | ||
@@ -82,0 +81,0 @@ default: |
@@ -49,7 +49,7 @@ "use strict"; | ||
.catch(async (e) => { | ||
var _a; | ||
var _a, _b; | ||
if (!(e instanceof dropbox_1.DropboxResponseError)) { | ||
throw e; | ||
} | ||
const errorMsg = e.error.error['.tag']; | ||
const errorMsg = (_a = e.error.error['.tag']) !== null && _a !== void 0 ? _a : e.error.error.reason['.tag']; | ||
if (typeof errorMsg !== 'string') | ||
@@ -61,4 +61,3 @@ throw e; | ||
case 'too_many_write_operations': | ||
const retryAfter = (_a = e.error.error.retry_after) !== null && _a !== void 0 ? _a : 1; | ||
console.log('now rerunning process!', retryAfter); | ||
const retryAfter = (_b = e.error.error.retry_after) !== null && _b !== void 0 ? _b : 1; | ||
return new Promise((res) => setTimeout(() => res(this.execAsync(lambda)), retryAfter)); | ||
@@ -65,0 +64,0 @@ default: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8019
180