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

Set a better error msg for non uft8 encoded files #5982

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

jecaro
Copy link
Contributor

@jecaro jecaro commented Nov 13, 2023

fix #5683

When the file doesn't contain the expected header, I first check if the file content is UTF-8 encoded. Depending on the result, I show a different message. For example, running roc on a binary file leads to this error:

── MISSING HEADER ───────────────────────────────────────────────── ./test.bin ─

I am expecting a header, but the file is not UTF-8 encoded.

I am expecting a module keyword next, one of interface, app, package
or platform.

Anton-4
Anton-4 previously approved these changes Nov 14, 2023
Copy link
Collaborator

@Anton-4 Anton-4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @jecaro!

@Anton-4 Anton-4 merged commit 7b1f2d2 into roc-lang:main Nov 14, 2023
14 checks passed
@jecaro jecaro deleted the error-msg-non-utf8 branch November 14, 2023 21:16
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

Successfully merging this pull request may close these issues.

Provide a nicer error when roc is provided a non-text file
2 participants