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

Remove the exception that logs an error when the subscription is cancelled #209

Merged
merged 1 commit into from Apr 5, 2022

Conversation

alexeyzimarev
Copy link
Member

Fixes #208

…n is properly cancelled by the cancellation token.
SubscriptionDropped(SubscriptionDroppedReason.SubscriberError, ex);

return;
}
}
} catch (Exception ex) {
} catch (RpcException ex) when (ex.Status.StatusCode == StatusCode.Cancelled &&
ex.Status.Detail.Contains("Call canceled by the client.")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

At the moment this hard coded string is checked in tests for grpc-dotnet; this is safe, for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe checking the status code is enough. I am not sure if the Cancelled status code produces any other message.

@thefringeninja thefringeninja merged commit 1a2b7aa into master Apr 5, 2022
@thefringeninja thefringeninja deleted the wrong-exception-handling branch April 5, 2022 11:37
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.

Error is logged when the subscription is properly stopped
3 participants