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

Emit error without line number #72

Open
segeljakt opened this issue Apr 21, 2023 · 3 comments
Open

Emit error without line number #72

segeljakt opened this issue Apr 21, 2023 · 3 comments

Comments

@segeljakt
Copy link

How do you emit an error which is not tied to a specific line number? For example, "File not found".

@zesterer
Copy link
Owner

There's not currently a way to do this, unfortunately. It would be relatively trivial to change this though: just make the initial offset field optional, and then wrap the error location code in an if let, I'd think.

@shilangyu
Copy link

Does it also mean that it is not possible to generate a report not tied to any source but rather the file itself?

For instance, in my language file names have to be valid identifiers, so I would like to print a ariadne-style error diagnostic if a file name is not that. Is that possible?

@zesterer
Copy link
Owner

zesterer commented May 8, 2023

That should be possible, yes: just use an offset pointing at the start of the file and don't include any labels.

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

3 participants