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 guidance #78

Closed
tfwright opened this issue Nov 20, 2023 · 1 comment
Closed

Error handling guidance #78

tfwright opened this issue Nov 20, 2023 · 1 comment

Comments

@tfwright
Copy link

Currently when parsing invalid CSV a ParseError is raised. This behavior isn't documented in function docs/type specs and would seem to violate the widespread convention of naming functions that can raise with a !.

I would propose to add some documentation around that (and possibly fix the type spec?)

As part of that it would be nice to offer some guidance on how to approach parsing CSV that may be invalid. Is catching the error the best approach?

@josevalim
Copy link
Member

Unfortunately, at the moment, raising is the best way to go. That's because the library was designed to work with streaming and, when streaming, it is tricky to error in the middle of streaming without raising (it is possible, just trickier) and changing it now would be backwards incompatible as you mentioned.

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