Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: suppress retry errors #24

Merged
merged 3 commits into from
Feb 16, 2024
Merged

feat: suppress retry errors #24

merged 3 commits into from
Feb 16, 2024

Conversation

rexfordessilfie
Copy link
Owner

Overview

This PR introduces a RetryError class that can be used to track errors that occur during a retry. This feature is inspired by the recently added SuppressedError to Typescript 5.2 as part of the introduction of using keyword in microsoft/TypeScript#54505.

Previously the retry function threw only the last error but following this change, now throws a RetryError, with the causing error on the instance's error property.

I would have preferred to subclass SuppressedError from Typescript vs re-implementing my own equivalent here, however SuppressedError does not look to be defined (even after updating to version 5.2). It appears to only available as a global type but not as a concrete class.

@rexfordessilfie rexfordessilfie merged commit fd077f7 into main Feb 16, 2024
2 checks passed
@rexfordessilfie rexfordessilfie deleted the suppress-retry-errors branch February 16, 2024 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant