File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/schema-to-typescript/common/core Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -210,11 +210,11 @@ ___
210
210
211
211
### shouldRetryOnError
212
212
213
- • ` Optional ` ** shouldRetryOnError** : (` error ` : ` Error ` , ` attemptNumber ` : ` number ` ) => ` boolean `
213
+ • ` Optional ` ** shouldRetryOnError** : (` error ` : ` Error ` , ` attemptNumber ` : ` number ` ) => ` boolean ` \| ` Promise ` \< ` boolean ` \>
214
214
215
215
#### Type declaration
216
216
217
- ▸ (` error ` , ` attemptNumber ` ): ` boolean `
217
+ ▸ (` error ` , ` attemptNumber ` ): ` boolean ` \| ` Promise ` \< ` boolean ` \>
218
218
219
219
Determine whether to retry on error.
220
220
@@ -227,7 +227,7 @@ Determine whether to retry on error.
227
227
228
228
##### Returns
229
229
230
- ` boolean `
230
+ ` boolean ` \| ` Promise ` \< ` boolean ` \>
231
231
232
232
## Methods
233
233
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export interface CommonHttpClientOptions {
74
74
/**
75
75
* Determine whether to retry on error.
76
76
*/
77
- shouldRetryOnError ?: ( error : Error , attemptNumber : number ) => boolean ;
77
+ shouldRetryOnError ?: ( error : Error , attemptNumber : number ) => boolean | Promise < boolean > ;
78
78
}
79
79
80
80
/**
@@ -868,7 +868,7 @@ export class CommonHttpClient {
868
868
}
869
869
return fetchResponse ;
870
870
} catch ( error ) {
871
- if ( ! this . options . shouldRetryOnError ?.( error as Error , attemptNumber ) ) {
871
+ if ( ! ( await this . options . shouldRetryOnError ?.( error as Error , attemptNumber ) ) ) {
872
872
throw error ;
873
873
}
874
874
attemptNumber ++ ;
You can’t perform that action at this time.
0 commit comments