Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling #205

Open
edencorbin opened this issue Aug 11, 2021 · 1 comment
Open

Error handling #205

edencorbin opened this issue Aug 11, 2021 · 1 comment

Comments

@edencorbin
Copy link

Feature Proposal

As far as I know if csv-parser encounters an error it silently stops on that row, while parsing all the previouse lines. Not knowing this I got far into a project and realized not all my rows were returning by reviewing the row count. I propose an on('error') method so that we can be aware of and handle these errors. After removing the problem line my whole CSV would parse.

Feature Use Case

Better error feedback and no swallowing of errors.

@chr4ss12
Copy link

chr4ss12 commented Sep 28, 2021

I would also add that some kind of detection of the BOM would have been good / automatic handling of it, I spent 3 hrs on debugging why the CSV parser shows me that I have csv record of

{ "Content id": "TEMPTEST" },

but when doing csv['Content id'] it results undefined, (because the key 'Content id' actually contains BOM as well, so the BOM is parsed as part of the first CSV field)

it would be good to throw error on that case, as having CSV files with bom is quite frequent occurence from excel exported files, and this library does not work with these files.

#196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants