-
Notifications
You must be signed in to change notification settings - Fork 484
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 #862
Comments
@martinagrzybowska can you share some more details about how you're able to trigger this error? |
I wrote, I am unable to recreate that error at will. I suspect it might happen when the Google Ads API suddenly cuts the connection. Here is an example of a whole stack trace, though it is not the same every time. `Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Hi, this is a weird bug which happens really often, though I have been unable to find out what type of error from the GRCP causes it, since the exception in this library always overshadows it. I think it might be caused by the library trying to raise something that is not an exception in line
self._get_error_from_response(response)
.Traceback (most recent call last): File "/app/ads_service/ads_client_handler.py", line 42, in inner return wrapped_function(self) File "/app/ads_service/search/search_service.py", line 15, in post result = self.search_stream( File "/app/ads_service/ads_client_handler.py", line 29, in inner return wrapped_function(*args, **kwargs) File "/app/ads_service/search/search_handler.py", line 22, in search_stream for batch in stream: File "/usr/local/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 119, in __next__ return next(self._wrapped) File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/interceptors/response_wrappers.py", line 108, in __next__ raise e File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/interceptors/response_wrappers.py", line 105, in __next__ self._failure_handler(self._underlay_call) File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/interceptors/exception_interceptor.py", line 71, in _handle_grpc_failure raise self._get_error_from_response(response) TypeError: exceptions must derive from BaseException
Expected behavior: The exception_interceptor throws an actual exception and does not result in exception itself while parsing it.
Client library version and API version:
Client library version: 24.0.0
Google Ads API version: default to the current GoogleAdsClient from this library
Flask==3.0.0
gunicorn==20.1.0
google-ads==24.0.0
marshmallow==3.18.0
flask_restful==0.3.9
google-auth==2.17.0
google-cloud-logging==3.2.2
google-cloud-secret-manager==2.16.1
python-dotenv==1.0.0
grpcio==1.60.0
pytest==7.4.2
The text was updated successfully, but these errors were encountered: