diff --git a/source/exponential-backoff.ts b/source/exponential-backoff.ts index 32b4355..b13274f 100644 --- a/source/exponential-backoff.ts +++ b/source/exponential-backoff.ts @@ -57,6 +57,7 @@ export class ExponentialBackoff { * @param options - The configuration for the exponential backoff * * @throws An {@link ExponentialBackoffMaxRetriesHitError} with all the errors that were thrown by the task function + * @throws An {@link ExponentialBackoffStoppedRetriesError} if the abort signal is activated * * @returns The result of the function */ @@ -163,6 +164,7 @@ export class ExponentialBackoff { * @param onError - The callback to call when an error occurs * * @throws An {@link ExponentialBackoffMaxRetriesHitError} with all the errors that were thrown by the task function + * @throws An {@link ExponentialBackoffStoppedRetriesError} if the abort signal is activated * * @returns The result of the function */ @@ -194,7 +196,7 @@ export class ExponentialBackoff { const errorInstance = error instanceof Error ? error : new Error(`${error}`); onError(errorInstance); - // If we have unlimited attemps, don't append this to the errors array to prevent a memory leak. + // If we have unlimited attempts, don't append this to the errors array to prevent a memory leak. if (!unlimitedAttempts) { errors.push(errorInstance); }