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

Get line number causing an error in edgeql

Open gsouf opened this issue 4 years ago • 4 comments

Hi,

I see that the command line for edgeql supports line/col causing an error;

image

Any ways we can get this feedback from the js client?

gsouf avatar Apr 06 '20 07:04 gsouf

It looks like that information is encoded in the attributes field in the ErrorResponse message documented here, and decoded in the JS client here, as a Map<number, Buffer>, but not exposed in the error. I've found the keys for the attrs map here, however the comment says they're subject to change/depreciation, so maybe that's why the attrs are not officially exposed, but it seems easy enough to modify the client if you need that information.

image

jaclarke avatar Apr 07 '20 12:04 jaclarke

If it's not flagged as stable yet then I'll prefer to wait. Can we keep this issue opened until it's officially available?

gsouf avatar Apr 07 '20 19:04 gsouf

Yeah, we plan to implement Language Server Protocol for EdgeDB, so the current attributes are indeed unstable (and undocumented IIRC). If I may ask, what's your intended use case?

1st1 avatar Apr 07 '20 20:04 1st1

@1st1 Thanks for the info. I'm doing an ui to interact with edgedb, I want to be able to provide a visual feedback when an error occurs

gsouf avatar Apr 07 '20 21:04 gsouf