unbridled-41 opened a new pull request, #5987:
URL: https://github.com/apache/rocketmq-dashboard/pull/5987
### Which Issue(s) This PR Fixes
Fixes #5986
### Problem / Evidence
```java
} catch (BusinessException exception) { throw
ToolExecutionException.from(exception); }
catch (RuntimeException exception) { throw
ToolError.UNEXPECTED_EXECUTION_FAILURE.exception(); }
```
`AbstractPrometheusCompatibleMetricsSource` throws `PrometheusException(400,
"Metric query start must be positive")`; the identical body against
`/api/metrics/query` returns 400 with that message:
```
ToolExecutorInvocationTest#keepsTheMetricsProviderStatusWhenAQueryIsRejectedTest
Expecting message to be: "Metric query start must be positive"
but was: "Tool execution failed unexpectedly."
```
### Root cause / Fix
Map the provider's typed failure through the same translation as a
BusinessException, so its status (400 for a bad query, 502 for an outage) and
message reach the caller.
### Priority and scoring
**PRIORITY 50** - impact 18/40 (a client-input error reported as a service
fault with the reason discarded), blast radius 10/20 (every metrics tool call),
reproducibility 20/20 (pinned by the new test), maintenance value 2/20.
**FIX_CONFIDENCE 78**.
### Tests
`cd server && mvn -o -B -ntp test
-Dtest='org.apache.rocketmq.studio.ops.ai.tool.**,MetricsControllerTest,PrometheusMetricsSourceTest'`
-> `Tests run: 206, Failures: 0, Errors: 0`; the new case fails before the
change and passes after it; `checkstyle:check` passes.
### Risk
A backend outage now surfaces as the provider's 502 instead of a tool 500,
which is more accurate; every other tool path is untouched.
--
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]