Documentation and spelling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user