| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This pull request introduces support for propagating custom Long-Running Operation (LRO) error details across both gRPC and HTTP/JSON transports. It adds the HttpJsonLroErrorParser interface, implements a ComputeLroErrorParser for Google Cloud Compute, and updates OperationSnapshot and ProtoOperationTransformers to carry ErrorDetails. However, the package matching logic in HttpJsonServiceStubClassComposer incorrectly targets com.google.cloud.compute.v1small as well, which will cause compilation failures in the generated golden files because ComputeLroErrorParser is package-private and unavailable in that package. This should be resolved by explicitly excluding v1small from the generator's condition.
Sorry, something went wrong.
| .apply("setError", Arrays.asList(getHttpErrorStatusCodeExpr, getHttpErrorMessageExpr)) | ||
| .apply(newBuilderExpr); | ||
|
|
||
| if (service.pakkage().startsWith("com.google.cloud.compute.v1")) { |
There was a problem hiding this comment.
The package check service.pakkage().startsWith("com.google.cloud.compute.v1") evaluates to true for "com.google.cloud.compute.v1small". This causes the generator to incorrectly inject .setErrorParser(new ComputeLroErrorParser()) into the v1small golden files (as seen in HttpJsonAddressesStub.java and HttpJsonRegionOperationsStub.java).
Since ComputeLroErrorParser is a hand-written class in com.google.cloud.compute.v1.stub and is package-private, it is not present or accessible in com.google.cloud.compute.v1small.stub, which will cause compilation failures when building the goldens.
To fix this and properly ignore the v1small package as intended, we should explicitly exclude it in the condition.
| if (service.pakkage().startsWith("com.google.cloud.compute.v1")) { | |
| if (service.pakkage().startsWith("com.google.cloud.compute.v1") | |
| && !service.pakkage().startsWith("com.google.cloud.compute.v1small")) { |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Overview
This PR implements POC 3 for custom LRO error details propagation. In this design, we encapsulate the custom error parsing concern directly inside HttpJsonOperationSnapshot during its instantiation lifecycle.
This approach keeps ProtoOperationTransformers completely clean and aligned with the gRPC implementation, avoiding the need for multiple overloads or passing custom error parser objects down to the response transformer.
Changes
1. GAX Core (gax-httpjson)
2. Generator (gapic-generator-java)
Verification