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

Expose error fields #475

Open
aljazerzen opened this issue Feb 7, 2024 · 1 comment
Open

Expose error fields #475

aljazerzen opened this issue Feb 7, 2024 · 1 comment
Assignees

Comments

@aljazerzen
Copy link

aljazerzen commented Feb 7, 2024

Currently, we do have property getters for error fields:

@property
def _position(self):
# not a stable API method
return int(self._read_str_field(FIELD_POSITION_START, -1))
@property
def _position_start(self):
# not a stable API method
return int(self._read_str_field(FIELD_CHARACTER_START, -1))
@property
def _position_end(self):
# not a stable API method
return int(self._read_str_field(FIELD_CHARACTER_END, -1))
@property
def _line(self):
# not a stable API method
return int(self._read_str_field(FIELD_LINE_START, -1))
@property
def _col(self):
# not a stable API method
return int(self._read_str_field(FIELD_COLUMN_START, -1))
@property
def _hint(self):
# not a stable API method
return self._read_str_field(FIELD_HINT)

... but they are not considered stable API. We should change that and also expose details field.

We do have similar code in the server:

https://github.com/edgedb/edgedb/blob/master/edb/errors/base.py#L178-L200

@msullivan
Copy link
Member

I think probably details should be dumped in the default formatting

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