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

Postgrest errors do not get caught, returns false positives #34

Closed
rphly opened this issue Jul 12, 2021 · 3 comments
Closed

Postgrest errors do not get caught, returns false positives #34

rphly opened this issue Jul 12, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rphly
Copy link

rphly commented Jul 12, 2021

Bug report

Describe the bug

Example error that gets returned in 'data' instead of in 'error' in response from an .insert operation

{'data': {'hint': None, 'details': 'Failing row contains (null, 4, open-chat, 2021-07-12 16:04:41.982201+00).', 'code': '23502', 'message': 'null value in column "id" violates not-null constraint'}, 'status_code': 400}

To Reproduce

You can easily reproduce this with most errors like not-null constraints, missing columns.

In this case, all I did was try to insert a row with a null value in a not-null column

Expected behavior

error is not None

@rphly rphly added the bug Something isn't working label Jul 12, 2021
@J0 J0 self-assigned this Jul 26, 2021
@J0
Copy link
Collaborator

J0 commented Jul 26, 2021

Hey @rphly,

Thanks for reporting the bug! Just writing to let you know that I've seen the issue -- will look into it :)

@dreinon
Copy link
Contributor

dreinon commented Oct 28, 2021

Hey @J0, have you been able to work on this at all?
If I get a bit of time this would be an issue I could handle 🙂

@dreinon
Copy link
Contributor

dreinon commented Feb 4, 2022

Hi! This has been solved in the new version of postgrest-py! Now an APIError gets raised in this case.

Thanks for the report! Closing this issue now, but feel free to reopen it or comment here again if you have any other concerns 🙂

@dreinon dreinon closed this as completed Feb 4, 2022
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
Status: Done
Development

No branches or pull requests

3 participants