You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "btlqql (via GitHub)" <gi...@apache.org> on 2026/08/17 08:49:54 UTC

[PR] fix(common): map unmapped routes and wrong methods to 404/405 instead of 500 [rocketmq-dashboard]

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): map unmapped routes and wrong methods to 404/405 instead of 500 [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #2310:
URL: https://github.com/apache/rocketmq-dashboard/pull/2310#issuecomment-5338110528

   Consolidated into #2243 (merged as c406a0cc) per the batch integration of related small fixes — closing.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): map unmapped routes and wrong methods to 404/405 instead of 500 [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #2310: fix(common): map unmapped routes and wrong methods to 404/405 instead of 500
URL: https://github.com/apache/rocketmq-dashboard/pull/2310


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org