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

Better error message when parsing data with BOM #1082

Open
adamgundry opened this issue Nov 7, 2023 · 0 comments
Open

Better error message when parsing data with BOM #1082

adamgundry opened this issue Nov 7, 2023 · 0 comments

Comments

@adamgundry
Copy link
Member

If an input bytestring starts with a BOM, aeson will fail to parse it as JSON with the error message "Error in $: Failed reading: not a valid json value". Rejecting the input is correct per the spec, and as discussed in #389 it is better for the application to remove the BOM before parsing if needed, rather than having aeson do it automatically.

However, it would be nice if the error message was more explicit about the cause of the problem. At least that would have saved me a bit of confusion when I couldn't get aeson to parse a JSON file that looked perfectly fine in my editor. :-)

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

1 participant