You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "gbidsilva (via GitHub)" <gi...@apache.org> on 2023/09/04 11:29:10 UTC

[GitHub] [commons-csv] gbidsilva commented on a diff in pull request #347: [CSV-147] Error message optimization during faulty CSV record read

gbidsilva commented on code in PR #347:
URL: https://github.com/apache/commons-csv/pull/347#discussion_r1314826686


##########
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 will have a look on this...
   Thanks for the review @garydgregory 



-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org