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


##########
src/main/java/org/apache/commons/csv/CSVParser.java:
##########
@@ -765,7 +805,14 @@ CSVRecord nextRecord() throws IOException {
         final long startCharPosition = lexer.getCharacterPosition() + 
this.characterOffset;
         do {
             this.reusableToken.reset();
-            this.lexer.nextToken(this.reusableToken);
+            // https://issues.apache.org/jira/browse/CSV-147
+            try {
+                this.lexer.nextToken(this.reusableToken);
+            } catch (IOException ioe) {
+                String errorMessage = "An exception occurred while parsing the 
CSV content. Issue in line: "
+                        + this.lexer.getCurrentLineNumber() + ", position: " + 
this.lexer.getCharacterPosition();

Review Comment:
   Done.
   However, column and position are two different things. Therefore kept the 
position as it is.
   lexer is not having any method to access the column as I see.
   



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