btlqql opened a new pull request, #2310: URL: https://github.com/apache/rocketmq-dashboard/pull/2310
## What is the purpose of the change Spring MVC throws NoResourceFoundException for unmatched routes and HttpRequestMethodNotSupportedException for wrong HTTP methods. With no dedicated handler, both fell through to the generic catch-all exception handler and were reported as HTTP 500 instead of the correct 404/405, and every such request logged a full error stack trace. ## Brief changelog - Added explicit @ExceptionHandler mappings so unmapped routes return 404, wrong methods return 405, and unsupported media types return 415, each wrapped in the standard Result envelope. - Added tests: a direct-handler assertion for the NoResourceFoundException -> 404 mapping, and a MockMvc assertion for wrong-method -> 405. ## How was this patch verified - `mvn -Dtest=GlobalExceptionHandlerTest test` -> 5/5 passed - `git diff --check` clean -- 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]
