edgedb-python icon indicating copy to clipboard operation
edgedb-python copied to clipboard

better query error reporting

Open 1st1 opened this issue 4 months ago • 1 comments

This is what we print now

gel.errors.EdgeQLSyntaxError: Missing parentheses around statement used as an expression
   ┌─ query:14:33
   │
14 │                                   with
   │                                   ^^^^ error

we need to include more code above/below for this to make sense.

1st1 avatar Aug 08 '25 22:08 1st1

Ah! We should drop code the following and reuse the same _format_error():

https://github.com/geldata/gel-python/blob/a5c880ed95a69041fecbe1dede53b8b2c2f9ba2f/gel/_internal/_codegen/_generator.py#L178-L205

fantix avatar Aug 08 '25 23:08 fantix