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

Return 500 error when a resource is not ready #442

Closed
severo opened this issue Jul 20, 2022 · 2 comments
Closed

Return 500 error when a resource is not ready #442

severo opened this issue Jul 20, 2022 · 2 comments
Milestone

Comments

@severo
Copy link
Collaborator

severo commented Jul 20, 2022

related to #404

If a dataset has been created, and the webhook has been triggered, the dataset should be in the queue. Before a worker has completed the creation of the response for the endpoints of this dataset, if a request is received on these endpoints, we currently return 400, telling that the resource does not exist.

It's better to check the content of the queue, and return a 500 error (the server has "failed" to create the resource in time). It allows to separate this case from a request to a non-existent dataset. A 500 error means that the client can retry with the same request later.

Another option would have been to return 200, with a response that includes the state (in progress / done) and the data if any, but it would show internals of the server, and most importantly, would make the client more complicated without a reason.

@severo severo added this to the Public API milestone Jul 20, 2022
@severo
Copy link
Collaborator Author

severo commented Jul 20, 2022

We will implement it only for /splits-next and /first-rows, since /splits and /rows will be deprecated and should remain unchanged until then.

severo added a commit that referenced this issue Jul 20, 2022
for /splits and /first-rows

✅ Closes: #442
@severo
Copy link
Collaborator Author

severo commented Jul 20, 2022

see #443

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

1 participant