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

Error messages should provide better context #282

Open
XAMPPRocky opened this issue Oct 12, 2023 · 1 comment
Open

Error messages should provide better context #282

XAMPPRocky opened this issue Oct 12, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@XAMPPRocky
Copy link

Edgedb's error messages can be quite unintuitive about what is needed to fix the error, what the error is, and it should include more information about the invalid query, and the errors should provide more actionable information for the user.

Some generic information that would be useful for all errors.

  • The query
  • The line and column of the error in the code (not the query).
  • Highlighting the line and column in the error.

Examples of unituitive errors:

This error is something to do with not referencing any inner property in a link property.

index out of bounds: the len is 1 but the index is 1

This error is caused when you're missing a field OR the field list in the query doesn't match the order of the Queryable struct, which is incredibly user-hostile, because you're only going to realise that's the problem through trial and error.

DescriptorMismatch

Caused by:
    unexpected field id, expected name

References the query instead of the code.

InvalidReferenceError: object type 'default::PendingSaga' has no link or property 'name' (on line 1, column 26)
@raddevon raddevon added the bug Something isn't working label Oct 12, 2023
@Dhghomon Dhghomon removed their assignment Feb 9, 2024
@MrFoxPro
Copy link
Contributor

Yeah I found it's very hard to understand what's goind wrong.
Just placing #[tracing::instrument(err, skip_all)] before fn encode(&self, buf: &mut BytesMut, val: &Value) helped tremendously understand what's going on.
I can add PR with this annotations on most major functions, what do you think? @raddevon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants