mchades opened a new pull request, #14577: URL: https://github.com/apache/gravitino/pull/14577
### What changes were proposed in this pull request? Map `InvalidPartitionsException` to `IllegalArgumentException` in Kafka topic creation, preserving the Kafka error message and cause. ### Why are the changes needed? Kafka rejects invalid partition counts such as `0` and `-2`, but the generic exception wrapper currently makes REST return HTTP 500 instead of 400. Fixes #14576 ### Does this PR introduce _any_ user-facing change? Yes. Invalid partition counts return HTTP 400 instead of 500. The valid `-1` broker-default behavior is preserved. ### How was this patch tested? - An embedded Kafka regression test for invalid partition counts fails before the fix. - New tests cover `0` and `-2`, preservation of Kafka's error message and cause, and `-1` resolving to the same partition count as an omitted value. - `./gradlew :catalogs:catalog-kafka:spotlessApply :catalogs:catalog-kafka:check -PskipITs` passes: all 17 unit tests. - `git diff --check` passes. - Docker integration tests were not run. -- 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]
