yyqdbngt opened a new pull request, #3779: URL: https://github.com/apache/rocketmq-dashboard/pull/3779
### Motivation The existing `GlobalExceptionHandlerTest` covers business, LLM-gateway, 404/405/406 mappings, but five handler branches were still unverified through the advice: unsupported operations, the generic catch-all, Prometheus failures, request-parameter type mismatches and unreadable request bodies. ### Changes - `unsupportedOperationReturns501Envelope`: `UnsupportedOperationException` maps to HTTP 501 with the exception message preserved. - `unexpectedExceptionReturns500Envelope`: the catch-all maps arbitrary runtime failures to HTTP 500 with the neutral `Internal Server Error` message (no leak). - `prometheusExceptionPreservesStatusAndMessage`: a Prometheus failure keeps its status code and message. - `typeMismatchParameterReturns400InvalidParameter`: a non-numeric path variable for an `int` parameter is reported as 400 with the generic parameter message. - `unreadableBodyReturns400InvalidBody`: a malformed JSON body is reported as 400 with the `Invalid request body` message. ### Verification ``` mvn -B test -Dtest=GlobalExceptionHandlerTest [INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS ``` -- 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]
