-
Notifications
You must be signed in to change notification settings - Fork 163
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
Table.scan finally breaks appropriate exception handling #138
Comments
mistake in last bit, the latter example raises
|
yeah, it's tricky. dunno what the "right" solution is unfortunately... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the
finally
block insideTable.scan
attempts to close the scanner, but if this fails, any error raised inside thetry
block is masked. Simple example is CTRL-C during a scan:I'm not sure if the
TProtocolException
is meaningful in this case, but my calling code would want to capture theKeyboardInterrupt
(or whatever the actual exception is).In practice, this may only be an issue with interrupts and degenerate code.
Here is a degenerate case which masks the fact that the connection is no longer open:
I would suggest wrapping the close inside a
try
block or otherwise attempting to cleanup in a safer mannerThe text was updated successfully, but these errors were encountered: