-
Notifications
You must be signed in to change notification settings - Fork 20
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
Errors API #804
Comments
github-merge-queue bot
pushed a commit
that referenced
this issue
May 27, 2024
Part of or might close #804 Rather than coming up with perfect API that ties everything together, let's start with the `Diagnostic` and iterate from there.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of an
Error
type, I suggest moving toDiagnsotic
notation, popularized by Roslyn, TypeScript, VS Code, and others.Diagnostic::message() -> String
to return a human readable string, usable in editors and downstream APIs.Diagnostic::kind() -> DiagnosticKind
to return an enum:ParserError
,ValidationError
, etc...Diagnostic::code() -> String
the string represenatation ofDiagnosticKind
, suitable to surface in editors and URLs (error glossary/wiki).Diagnostic::severity() -> DiagnosticSeverity
to return an enum:Error
,Warning
,Info
, etc... (same as LSP severity levels)Diagnostic::location()
for file/range info.As for the errors API:
ariadne
reports from the API (should only be the CLI).FileNotFound
), instead of just panicking.The text was updated successfully, but these errors were encountered: