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

count: exact and head: true hides errors #481

Open
steve-chavez opened this issue Sep 26, 2023 · 0 comments
Open

count: exact and head: true hides errors #481

steve-chavez opened this issue Sep 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@steve-chavez
Copy link
Member

Problem

If a table has a high count (say 30_000_000), doing:

supabase
.from('table')
.select('id', {count: 'exact', head: true})

Will result in an uninformative error:

{
error: { message: '' },
data: null,
count: null,
status: 500,
statusText: 'Internal Server Error'
}

By removing the head: true (untested, but assuming is the same as curl), we get the actual error:

{"code":"57014","details":null,"hint":null,"message":"canceling statement due to statement timeout"}

Solution

Somehow expose the error message when this happens. Not sure if possible, this might need a special status code from upstream.

@steve-chavez steve-chavez added the bug Something isn't working label Sep 26, 2023
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
None yet
Development

No branches or pull requests

1 participant