-
Notifications
You must be signed in to change notification settings - Fork 11
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
Get details of ConstraintViolationError #269
Comments
I don't think that there is structured information like that by default. I may be wrong though. I'll double check tomorrow. However, you can override the error message with whatever you want including structured data like json. You will still have to parse it, but its better than parsing an error message. |
Here is a link to the relevant documentation. |
I confirmed that the server doesn't send any structured data that indicates which constraint has been violated. |
@fmoor thanks! Not high a priority, but would be nice to have it someday to make error handling more reliable. |
For whoever stumbles on this issue, we plan to refactor errors in EdgeQL it self. This will improve a lot of things. Information about constraint violations being one of them. |
Is it possible to extract information about constraint violation error from
edgedb.Error
?Idea is that I'm interested in knowing which field exactly has violated constraints (say, is it an
email
field of User or something else), so the different actions can be taken.Seems like right now the only way is to parse a string "email violates exclusivity constraint", which is not reliable way in a long term.
The text was updated successfully, but these errors were encountered: