-
Notifications
You must be signed in to change notification settings - Fork 203
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
TypeError: exceptions must derive from BaseException #163
Comments
@mjhuber Since the code sample is not self-contained, I could not run it, and modifying it by providing e.g. a generic callback did not result in a successful reproduction, unfortunately. I had to revert to tracing through the code and tried to guess the reason. The Now, an exception on the future can be set in a callback the future registers on the streaming pull manager, and is invoked when the manager is shut down: python-pubsub/google/cloud/pubsub_v1/subscriber/futures.py Lines 29 to 44 in b1bfc9e
This shutdown can be triggered, for instance, when the underlying RPC terminates without recovery: python-pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py Lines 683 to 700 in b1bfc9e
The reason for the shutdown is passed as an argument to the abovementioned future's on close callback and should be an exception instance. The following should convert the RPC's future to an exception, but that does not happen it seems: future = _maybe_wrap_exception(future) The helper function can convert As I said, I could not reproduce the error, but could you do a quick debug session (or add additional logging) and confirm this theory? Does the error occur in the thread If proved correct, the fix should be straightforward - the Thanks in advance! |
using the subscriber client api a TypeError will often get thrown from
pubsub_v1/futures.py
. Consider the following:this bit of code in pubsub_v1/futures.py can return a TypeError
exceptions must derive from BaseException
:The type returned from
self.exception
can be of type<opencensus.ext.grpc.utils.WrappedResponseIterator object>
which is not of type Exception.Environment details
google-cloud-pubsub
version: 1.7.0The text was updated successfully, but these errors were encountered: