Document await in exponential backoff run function

This commit is contained in:
2026-07-11 12:54:42 +00:00
parent 06cc8eff25
commit e726d1c25a

View File

@@ -90,6 +90,8 @@ export class ExponentialBackoff {
while (attempt < this.options.maxAttempts || unlimitedAttempts) {
try {
// Await the promise before returning so its execution context remains in the try-catch
// If we didn't await, this `run` function would successfully return and any errors would not be caught here.
return await taskFn();
} catch (error) {
// Store the error in case we fail every attempt