@upyo/jmap 0.5.0-dev.164 → 0.5.0-dev.168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -208,12 +208,16 @@ var JmapHttpClient = class {
|
|
|
208
208
|
if (error.statusCode >= 400 && error.statusCode < 500) throw error;
|
|
209
209
|
}
|
|
210
210
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
211
|
-
if (attempt === this.config.retries)
|
|
211
|
+
if (attempt === this.config.retries) {
|
|
212
|
+
if (error instanceof JmapApiError) throw error;
|
|
213
|
+
throw new JmapApiError(lastError.message, void 0, void 0, void 0, void 0, attempt + 1);
|
|
214
|
+
}
|
|
212
215
|
const delay = Math.pow(2, attempt) * 1e3;
|
|
213
216
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
|
-
|
|
219
|
+
if (lastError != null) throw lastError;
|
|
220
|
+
throw new Error("Request failed after all retries");
|
|
217
221
|
}
|
|
218
222
|
/**
|
|
219
223
|
* Makes an authenticated fetch request.
|
package/dist/index.js
CHANGED
|
@@ -185,12 +185,16 @@ var JmapHttpClient = class {
|
|
|
185
185
|
if (error.statusCode >= 400 && error.statusCode < 500) throw error;
|
|
186
186
|
}
|
|
187
187
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
188
|
-
if (attempt === this.config.retries)
|
|
188
|
+
if (attempt === this.config.retries) {
|
|
189
|
+
if (error instanceof JmapApiError) throw error;
|
|
190
|
+
throw new JmapApiError(lastError.message, void 0, void 0, void 0, void 0, attempt + 1);
|
|
191
|
+
}
|
|
189
192
|
const delay = Math.pow(2, attempt) * 1e3;
|
|
190
193
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
|
-
|
|
196
|
+
if (lastError != null) throw lastError;
|
|
197
|
+
throw new Error("Request failed after all retries");
|
|
194
198
|
}
|
|
195
199
|
/**
|
|
196
200
|
* Makes an authenticated fetch request.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upyo/jmap",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.168",
|
|
4
4
|
"description": "JMAP transport for Upyo email library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@upyo/core": "0.5.0-dev.
|
|
56
|
+
"@upyo/core": "0.5.0-dev.168+1e808a3a"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"jmap-rfc-types": "^0.1.2",
|