abhishekrb19 opened a new pull request, #16684: URL: https://github.com/apache/druid/pull/16684
Currently, when retrieving an Avro schema from the registry and if the request fails with an `IOException` or a `RestClientException`, we bubble this generic error up to the user: ``` "Failed to fetch Avro schema id[233323] from registry. Check if the schema exists in the registry. Otherwise it could mean that there is malformed data in the stream or data that doesn't conform to the schema" specified." ``` However, this error message is however misleading in cases where the rest client is throwing unauthorized/forbidden error codes. So we now handle `IOException` and `RestClientException` separately so that we can bubble up more specific errors rather than the common template. Added unit tests for the change and also cleaned up test annotations `@Test(expected = ParseException.class)` by adding better tests assertions. <!-- Thanks for trying to help us make Apache Druid be the best it can be! Please fill out as much of the following information as is possible (where relevant, and remove it when irrelevant) to help make the intention and scope of this PR clear in order to ease review. --> <!-- Please read the doc for contribution (https://github.com/apache/druid/blob/master/CONTRIBUTING.md) before making this PR. Also, once you open a PR, please _avoid using force pushes and rebasing_ since these make it difficult for reviewers to see what you've changed in response to their reviews. See [the 'If your pull request shows conflicts with master' section](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#if-your-pull-request-shows-conflicts-with-master) for more details. --> This PR has: - [x] been self-reviewed. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
