jamesnetherton opened a new pull request, #648:
URL: https://github.com/apache/camel-quarkus-examples/pull/648

   After camel-quarkus switched its Jackson extensions to `camel-jackson3`, 
`TicketTriageTest.invalidTicketsAreRejectedBeforeCallingTheModel` fails with 
`Expected status code <400> but was <502>` ([CI 
run](https://github.com/apache/camel-quarkus/actions/runs/45974579893)).
   
   The 400 handler matched 
`com.fasterxml.jackson.core.JsonProcessingException`, but Jackson 3 throws 
`tools.jackson.core.JacksonException`. The two share no supertype other than 
`Exception`, so a malformed ticket fell through to the 502 catch-all.
   
   The ticket is now parsed and validated in a `doTry` block, and `doCatch` 
replies with HTTP 400. No Jackson exception type is referenced, so this works 
with both Jackson 2 and 3. JSON errors later in the route, such as when parsing 
the model output, still map to 502.
   
   Rethrowing an `InvalidTicketException` from `doCatch` doesn't work: 
exceptions thrown there aren't handled by the route's `onException` clauses. 
That's why the response is built directly in `doCatch`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to