jiriOndrusek-agent commented on code in PR #648:
URL:
https://github.com/apache/camel-quarkus-examples/pull/648#discussion_r4719498851
##########
a2a-openai/orchestrator/src/main/java/org/acme/a2a/openai/ticket/triage/orchestrator/TicketTriageRoutes.java:
##########
@@ -71,8 +59,20 @@ public void configure() {
from("platform-http:/tickets?httpMethodRestrict=POST&consumes=application/json&produces=application/json")
.routeId("ticket-triage")
+ // A ticket that cannot be parsed or fails validation is
rejected with HTTP 400. The details are logged,
+ // the caller only gets a generic message so that nothing
about the internals leaks out. Only these
+ // steps are the caller's fault: JSON errors later in the
route are server side problems (HTTP 502).
+ .doTry()
.unmarshal().json(Ticket.class)
.process(support::validateTicket)
+ .endDoTry()
+ .doCatch(Exception.class)
Review Comment:
Nit: `Exception.class` is wider than the old handler, so a server-side bug
in unmarshal/validate would become a 400 with a WARN message only. That makes
sense, since Jackson 2/3 have no common supertype. Maybe add a short comment
saying it's deliberate so nobody narrows it back to a Jackson type later.
Optionally log `${exception.stacktrace}` at DEBUG.
_Generated with [Claude Code](https://claude.com/claude-code) on behalf of
@JiriOndrusek_
--
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]