Restservice httprequestexception propagation #2539
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
There are two changes:
AggregateExceptionas an inner exception of the final thrownHttpRequestException.HttpResponse. If the content is not JSON, we throw anHttpRequestExceptionas an InnerException with the correspondingStatusCode.Why
This change was made to avoid suppressing exceptions when communicating with the
SchemaRegistry. We discovered that when using the AVRO schema for deserializing a Kafka message, we would get an error:without propagating the response
StatusCode. In this case, the status was 403: Forbidden. This change makes it easier to debug networking errors.Similar to the first change, this occurred when serializing a Kafka message in the producer using the AVRO schema registry. We received an error:
Debugging revealed that this happened when the
HttpResponse.StatusCodewas 403: Forbidden, and parsing into JSON failed. The default value oferrorCode(-1) was then thrown as aSchemaRegistryException.Checklist
Contains customer-facing changes? Including API/behavior changes
Did you add sufficient unit and/or integration test coverage for this PR?
Open Questions / Follow-ups
The method
ExecuteOnOneInstanceAsyncmay need further review, as these fixes might not be sufficient for differentHttpResponsescenarios.