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 HTTP response code to ErrorEvent #69

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

vyndor
Copy link
Contributor

@vyndor vyndor commented Oct 6, 2023

Description

Add HTTP response code to ErrorEvent.
There is an alternative approach to this PR.

In my opinion it would be better to pass whole response to ErrorEvent, but it will expose okhttp in centrifuge API.

Why our project needs this

Our project needs an ability to change an endpoint in case of specific errors:

  • UnknownHostException, SocketTimeoutException
  • Some subset of HTTP response codes. For example 410

HTTP status codes currently does not exposed by centrifuge SDK, so we do not know when we need to change endpoint.

@FZambia
Copy link
Member

FZambia commented Oct 7, 2023

@vyndor many thanks! Do you plan to change the endpoint by re-instantiating client? Or we need a method for that?

@vyndor
Copy link
Contributor Author

vyndor commented Oct 9, 2023

@FZambia many thanks! Do you plan to change the endpoint by re-instantiating client? Or we need a method for that?

Yes, I create new instance of Client with new endpoint.
Though it would be better to have an ability to change endpoint on the same instance of Client.

@FZambia FZambia merged commit d504e2f into centrifugal:master Oct 12, 2023
4 checks passed
@FZambia FZambia mentioned this pull request Aug 22, 2024
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.

2 participants