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

Missing key exception when raising StrayQuoteError #96

Closed
rockwood opened this issue Jul 9, 2020 · 2 comments
Closed

Missing key exception when raising StrayQuoteError #96

rockwood opened this issue Jul 9, 2020 · 2 comments

Comments

@rockwood
Copy link

rockwood commented Jul 9, 2020

Parsing an invalid CSV that contains stray quotes raises a KeyError instead of the expected StrayQuoteError. It appears that yield_or_raise!/2 is not passing the correct arguments to the exception.

image

key :field not found in: [message: "=", line: 2]
 elixir lib/keyword.ex:399 Keyword.fetch!/2
 csv lib/csv/exceptions.ex:46 CSV.StrayQuoteError.exception/1
 csv lib/csv.ex:214 CSV.yield_or_raise!/2
 elixir lib/stream.ex:572 anonymous fn/4 in Stream.map/2
 elixir lib/enum.ex:3686 Enumerable.List.reduce/3
 elixir lib/stream.ex:931 Stream.do_list_transform/7
 elixir lib/stream.ex:1609 Enumerable.Stream.do_each/4

Let me know if I'm doing something wrong. I'm happy to work on a PR.

@beatrichartz
Copy link
Owner

Hey @rockwood thanks for raising this this is fixed in 2.4.0 - give it a go and let me know if you run into further issues.

@rockwood
Copy link
Author

Thanks @beatrichartz!

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