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

Add methods for detecting retriable and fatal Ably exceptions #929

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

KacperKluka
Copy link
Contributor

Added helper methods that will enable us to detect fatal and retriable errors. This should allow us to implement appropriate retry mechanisms for certain Ably operations (like presence enter and leave).

Open questions:

  • should we only look at the code property or maybe also at the statusCode?
  • how should we classify exceptions that have codes that doesn't start with either 4 or 5?

@KacperKluka KacperKluka linked an issue Jan 20, 2023 that may be closed by this pull request
@KacperKluka KacperKluka self-assigned this Jan 20, 2023
@github-actions github-actions bot temporarily deployed to staging/pull/929/dokka January 20, 2023 14:58 Inactive
Copy link
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

@KacperKluka
Copy link
Contributor Author

I don't think there's any case that's not a 4xx or a 5xx. I think I'd prefer that there's an error logged in that case - even if statusCode == 0.

@paddybyers I've created an issue for this (#931) as this is a bit tricky to do right and seems a bit out of scope of this PR 😉

@QuintinWillison QuintinWillison dismissed paddybyers’s stale review January 23, 2023 09:52

Conversation resolved.

@QuintinWillison QuintinWillison merged commit 8b02b88 into main Jan 23, 2023
@QuintinWillison QuintinWillison deleted the feature/retry-ably-operations-core branch January 23, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Retry behaviour improvements for Ably API calls
4 participants