jerryshao opened a new pull request, #14018: URL: https://github.com/apache/gravitino/pull/14018
### What changes were proposed in this pull request? - `JobManager.alterJobTemplate` now converts `EntityAlreadyExistsException` into `JobTemplateAlreadyExistsException` instead of a plain `RuntimeException`, and unwraps the new name so the message no longer prints `Optional[...]`. - Declare `JobTemplateAlreadyExistsException` on `SupportsJobs#alterJobTemplate` and `JobOperationDispatcher#alterJobTemplate`. ### Why are the changes needed? Renaming a job template to an existing name returned 500 with a misleading message. It should return 409 so clients can ask the user to pick another name. Fix: #14017 ### Does this PR introduce _any_ user-facing change? Yes. A rename collision now returns HTTP 409 (`JobTemplateAlreadyExistsException`) instead of 500. Java and Python clients already map 409 to `JobTemplateAlreadyExistsException`. ### How was this patch tested? - Added `TestJobManager#testAlterJobTemplateRenameToExistingName`. - Added a 409 case to `TestJobOperations#testAlterJobTemplate`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
