-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix(client): Checks if the gateway is already closed before trying to shutdown the gateway #104
fix(client): Checks if the gateway is already closed before trying to shutdown the gateway #104
Conversation
… shutdown the gateway
Client/ZeebeClient.cs
Outdated
} | ||
catch (System.Exception) | ||
{ | ||
// ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please lets not ignore exceptions. Is there a specific reason for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Dispose()
should never throw exceptions, and there's no guarantee that ShutdownAsync
won't throw here (in fact there's a fair chance it actually will throw...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said; If you'd rather have the exception be thrown here, I can remove the try-catch. The real fix is the guard above that will make sure we're not calling ShotdownAsync()
on a ClosedGatewayClient
(which is guaranteed to throw an exception)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah lets remove it
Hey @bulldetektor first of all thanks so much for your contribution I appreciate it! Is there a reason why implemented for the PublishMessageCommand only and how is it related to #39? |
The relation to #39 is that handling exceptions in As for why I only implemented it for the |
@bulldetektor ah thanks for the explanation, makes sense thanks. I have overseen that you used the I assume we could also add an unit test that we can close the client twice. |
…when disposing multiple times
@Zelldon I removed the try-catch and added a unit test that verifies that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks 👍
related to #39