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

Should we change 500 to another status code when the error comes from the dataset? #1662

Open
severo opened this issue Aug 10, 2023 · 2 comments
Labels
api P2 Nice to have question Further information is requested

Comments

@severo
Copy link
Collaborator

severo commented Aug 10, 2023

See #1661 for example.

Same for the "retry later" error: is 500 the most appropriate status code?

@severo severo added question Further information is requested api P2 Nice to have labels Aug 10, 2023
@severo
Copy link
Collaborator Author

severo commented Aug 11, 2023

Also: many 501 errors should be 500 (or something else). For example, if the cache directory has not been initialized before job compute, it's a server internal error (we should have initialized it). It's not that we did not implement something.

https://github.com/huggingface/datasets-server/blob/4c189b1cfb51dd19d7c448478d51d0dcf2db86d1/libs/libcommon/src/libcommon/exceptions.py#L145

@severo
Copy link
Collaborator Author

severo commented Aug 14, 2023

see also #998. Copying relevant comments here:

Context @severo's comment #995 (comment)
For now we support only error 500 INTERNAL_SERVER_ERROR and 501 NOT_IMPLEMENTED error as part of custom Exception classes in worker project.
But this could be misunderstood since we manage those error in purpose and they are not a result of another request or dependent module.
We should evaluate each case and change to an appropiate HTTPStatus code.

It's a bit weird to return INTERNAL_SERVER_ERROR because we do it on purpose. Not sure which code we should return (theoretically it could be a 30x code because another endpoint has the response, but we only manage OK and error responses for now).
But it's not the only place where the return code is weird, I think. We might want to review all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api P2 Nice to have question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant