davsclaus opened a new pull request, #26802:
URL: https://github.com/apache/camel/pull/26802
The error registry records the body type per step since 4.23:
```
foo[to1] (1 ms) bodyType=java.util.LinkedHashMap bodySize=214
```
It does not say **where** that step is. The Message History table printed
with a failure has had a `Source` column (`orders.camel.yaml:18`) for much
longer, so the one place that says what the body was is the one place that does
not say which line produced it. A person maps `to3` back to a line by reading
the file; an AI agent holding that file — the camel-jbang-mcp
`camel_get_errors` tool returns exactly these strings — cannot make the mapping
at all.
Measured on the local-model benchmark (s15, 65 steps): the model called
`camel_get_log` 63 times and `camel_get_errors` 25 times, so it does read the
failure output. None of it named a line in the file it was editing.
### Change
- `DefaultErrorRegistry` — each step string gains its node's location,
written the way every other caller writes it:
`LoggerHelper.getLineNumberLoggerName(history.getNode())`, as `MessageHelper`
and `ManagedBacklogDebugger` already do for the same object. `LoggerHelper` was
already imported here and already used for the failing node.
```
foo[to1] orders.camel.yaml:18 (1 ms) bodyType=java.util.LinkedHashMap
```
The dev console and the camel-jbang-mcp tool both print these strings, so
both get it from one change.
- `ErrorRegistryConsole` — the entry shows the failure's own location, which
the registry already captured and never printed.
Nothing is appended when source location is off, so the step keeps its
shape. No API change: `getLocation()` is already on `BacklogEventMessage`, and
line numbers are already captured under the dev profile, which `camel run` uses
by default.
### Testing
New `ErrorRegistrySourceLocationTest` (2 tests): every step names a source
location when source location is on, next to the body type; the step keeps its
shape when it is off. `ErrorRegistry*`, `MessageHistory*` and `LineNumber*` in
camel-core (31 tests) and the camel-console suite (221 tests) pass.
Part of CAMEL-24844.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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]