You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
Was updating some samples and found when calling the Google Cloud Vision API with the python client library which has some handwritten helper methods making it a partial GAPIC library, that if the users passes a URL that the API can't reach, the API returns an error message, but the client library doesn't throw the error rather returns it as part of the response.
Call request: response = client.text_detection(image=image)
If you examine the response object from the api you'll find this:
error {
code: 3
message: "The URL does not appear to be accessible by us. Please double check or download the content and pass it in."
}
I think the generator is being faithful to the proto representation of the API, but it should be possible to convert the errors at the handwritten layer if desired.
Activity
busunkim96 commentedon Aug 10, 2020
It doesn't look like the handwritten layer is changing the error. I get the same result when I call
batch_annotate_imagesdirectly:I believe this is because the API returns a
Responseobject with an error field instead of a gRPC error. Seewrap_method,wrap_errors, and_wrap_unary_errors.The code that triggers a conversion from gRPC error to
google.api_core.exceptionschecks for agrpc.RpcError.I think the generator is being faithful to the proto representation of the API, but it should be possible to convert the errors at the handwritten layer if desired.
munkhuushmgl commentedon Sep 23, 2020
@busunkim96 Let me know how I can help to resolve this issue.