davsclaus opened a new pull request, #31103: URL: https://github.com/apache/camel/pull/31103
JIRA: [CAMEL-27765](https://issues.apache.org/jira/browse/CAMEL-27765) When a file consumer rolls a file back, its WARN did not say why: ``` WARN ... GenericFileOnCompletion : Rollback file strategy: ...GenericFileRenameProcessStrategy@7dbd938b for file: GenericFile[a.txt] ``` Often the error handler has logged the exception already, but not always. When an exception from a `doTry` matches no `doCatch` (or with `noErrorHandler`), the error handler never sees it, so the cause did not appear anywhere in the log. The timer consumer logs it in that case; the file consumers did not. ## Changes - `GenericFileOnCompletion.processStrategyRollback()`: the WARN now ends with `due to: <exception>` and carries the stack trace, as the timer consumer does. An intended rollback (`RollbackExchangeException`, e.g. the `rollback` EIP) gets the message but no stack trace, the same rule as `LoggingExceptionHandler`. - The `Rollback file strategy` prefix is unchanged, so the CLI reload-outcome parsing (`ReloadOutcomeTest`) keeps working. - One change covers all consumers built on `GenericFileConsumer`: file, ftp, ftps, sftp, smb and azure-files. The WARN with the default error handler now repeats a stack trace the error handler already logged at ERROR. This was chosen deliberately (option a in the JIRA analysis): the line is always self-explaining, the same as the timer consumer. ## Tests - New `FileConsumerRollbackLogsExceptionTest` (camel-core): the ticket's route (a `doTry` that throws `IllegalStateException`, a `doCatch` for `IOException` only) asserts that the WARN has the exception and its stack trace, and a `rollback` route asserts the message without a stack trace. - All 596 tests in `org.apache.camel.component.file` of camel-core pass. _Claude Code on behalf of davsclaus_ 🤖 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]
