File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.36.0 (六月 06, 2025)
2
+
3
+ - fix: throw original error in pRetry
4
+
1
5
## 0.35.1 (六月 05, 2025)
2
6
3
7
- feat: always retry for 5xx errors
Original file line number Diff line number Diff line change @@ -320,18 +320,23 @@ class BaseClient {
320
320
message = `GraphQLError: ${ message } ` ;
321
321
}
322
322
323
- const err = res . status >= 500 ? new Error ( message ) : new pRetry . AbortError ( message ) ;
324
- err . errors = json . errors ;
325
- err . status = res . status ;
323
+ const originalError = new Error ( message ) ;
324
+ originalError . errors = json . errors ;
325
+ originalError . status = res . status ;
326
+
327
+ const err = res . status >= 500 ? originalError : new pRetry . AbortError ( originalError ) ;
326
328
throw err ;
327
329
}
328
330
329
331
// Handle HTTP errors
330
332
if ( res . status !== 200 ) {
331
333
const message = json . error || json . message || `GraphQL Status Error ${ res . status } ` ;
332
- const err = res . status >= 500 ? new Error ( message ) : new pRetry . AbortError ( message ) ;
333
- err . status = res . status ;
334
- err . response = json ;
334
+
335
+ const originalError = new Error ( message ) ;
336
+ originalError . status = res . status ;
337
+ originalError . response = json ;
338
+
339
+ const err = res . status >= 500 ? originalError : new pRetry . AbortError ( originalError ) ;
335
340
throw err ;
336
341
}
337
342
Original file line number Diff line number Diff line change 1
- 0.35.1
1
+ 0.36.0
You can’t perform that action at this time.
0 commit comments