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 @@ ___
210210
211211### shouldRetryOnError
212212
213- • ` Optional ` ** shouldRetryOnError** : (` error ` : ` Error ` , ` attemptNumber ` : ` number ` ) => ` boolean `
213+ • ` Optional ` ** shouldRetryOnError** : (` error ` : ` Error ` , ` attemptNumber ` : ` number ` ) => ` boolean ` \| ` Promise ` \< ` boolean ` \>
214214
215215#### Type declaration
216216
217- ▸ (` error ` , ` attemptNumber ` ): ` boolean `
217+ ▸ (` error ` , ` attemptNumber ` ): ` boolean ` \| ` Promise ` \< ` boolean ` \>
218218
219219Determine whether to retry on error.
220220
@@ -227,7 +227,7 @@ Determine whether to retry on error.
227227
228228##### Returns
229229
230- ` boolean `
230+ ` boolean ` \| ` Promise ` \< ` boolean ` \>
231231
232232## Methods
233233
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export interface CommonHttpClientOptions {
7474 /**
7575 * Determine whether to retry on error.
7676 */
77- shouldRetryOnError ?: ( error : Error , attemptNumber : number ) => boolean ;
77+ shouldRetryOnError ?: ( error : Error , attemptNumber : number ) => boolean | Promise < boolean > ;
7878}
7979
8080/**
@@ -868,7 +868,7 @@ export class CommonHttpClient {
868868 }
869869 return fetchResponse ;
870870 } catch ( error ) {
871- if ( ! this . options . shouldRetryOnError ?.( error as Error , attemptNumber ) ) {
871+ if ( ! ( await this . options . shouldRetryOnError ?.( error as Error , attemptNumber ) ) ) {
872872 throw error ;
873873 }
874874 attemptNumber ++ ;
You can’t perform that action at this time.
0 commit comments