elharo commented on code in PR #347:
URL: https://github.com/apache/commons-csv/pull/347#discussion_r1315124751
##########
src/main/java/org/apache/commons/csv/CSVParser.java:
##########
@@ -765,7 +765,13 @@ CSVRecord nextRecord() throws IOException {
final long startCharPosition = lexer.getCharacterPosition() +
this.characterOffset;
do {
this.reusableToken.reset();
- this.lexer.nextToken(this.reusableToken);
+ try {
+ this.lexer.nextToken(this.reusableToken);
+ } catch (IOException ioe) {
+ String errorMessage = "Exception during parsing at line: "
+ + this.lexer.getCurrentLineNumber() + ", position: " +
this.lexer.getCharacterPosition();
Review Comment:
I vote for number 1. try to keep exception logic in one place.
--
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]