mayurbm opened a new pull request, #25845:
URL: https://github.com/apache/camel/pull/25845
## Summary
- Wraps `IOException` and `UncheckedIOException` thrown by Apache Commons
CSV during unmarshal with a diagnostic message that identifies the root cause
and guides operators toward a fix.
- Adds a `wrapCsvParseError(IOException)` helper on `CsvUnmarshaller`
(abstract base) called from `BulkCsvUnmarshaller` catch blocks.
- Adds `CsvUnmarshalErrorMessageTest` with 3 tests covering:
encapsulated-token error message content, original cause preserved, and valid
CSV passes through unchanged.
**Before:**
```
java.io.IOException: (line 1) invalid char between encapsulated token and
delimiter
```
**After:**
```
CSV parse failed: (line 1) invalid char between encapsulated token and
delimiter.
A quoted field has extra characters after the closing quote and before the
delimiter
(example: "abc"x,def). Check delimiter, quote character, and escaped quotes
("").
```
This is a cosmetic/diagnostic-only change — bad CSV still fails, it just
fails with a clearer message. No behavior, API, or data format change.
Fixes: https://issues.apache.org/jira/browse/CAMEL-24546
_Claude Code on behalf of mayurbm_
## Test plan
- [ ] `mvn test -pl components/camel-csv` passes (96 tests, 0 failures)
- [ ] `CsvUnmarshalErrorMessageTest` — 3 new tests all green
- [ ] No regression in existing CSV marshal/unmarshal tests
--
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]