You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(retry): add shouldRetry option
Add shouldRetry option to control retry behavior based on error type.
This allows users to retry only on specific errors (e.g., 500+ status codes).
* Apply suggestions from code review
* [autofix.ci] apply automated fixes
* fix
---------
Co-authored-by: Sojin Park <raon0211@toss.im>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
-`retries` (`number`, optional): The number of times to retry. Defaults to `Infinity` for infinite retries.
87
114
-`delay` (`number | (attempts: number) => number`, optional): The retry interval (in milliseconds). Can be a number or a function. Defaults to `0`.
88
115
-`signal` (`AbortSignal`, optional): A signal that can cancel retries.
116
+
-`shouldRetry` (`(error: unknown, attempt: number) => boolean`, optional): A function that determines whether to retry. If it returns `false`, the error is thrown immediately.
117
+
-`error`: The error object that occurred.
118
+
-`attempt`: The current attempt count (starting from 0).
0 commit comments