yyqdbngt opened a new pull request, #2949: URL: https://github.com/apache/rocketmq-dashboard/pull/2949
## Summary - normalize the `BusinessException` status code in the constructor: keep codes in the 4xx/5xx band, fall back to 400 for anything else - add a regression test covering pass-through codes, out-of-band codes, and message passthrough ## Why `GlobalExceptionHandler` maps the exception code directly onto the HTTP status line via `ResponseEntity.status(code)`, which internally calls `HttpStatus.valueOf(code)`. A business exception constructed with a code outside the 100–599 band (e.g. 0 or 600) would make the handler itself throw, converting the business error into an opaque 500; a 2xx/3xx code would answer the error with a success or redirect status while the body still says "error" — a status/message inconsistency. All current call sites already use 401–504, so this only changes behavior for future misuse. ## Testing - `cd server && mvn -q -Dtest=BusinessExceptionTest test` — 3 tests pass (new class) - `cd server && mvn -q -Dtest=GlobalExceptionHandlerTest test` — all tests pass (regression for the exception envelope) -- 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]
