-
Notifications
You must be signed in to change notification settings - Fork 114
Error response need precise definition #382
Comments
@sarahhunt describes search error behavior of Ensemb implementation of API in ga4gh/ga4gh-server#576 (comment) re searching for something that doesn't exist - We're currently returning HTTP/1.0 I agree, error handling needs to be specified exhaustively. @diekhans would have expected an empty set. |
There's a sublety here @diekhans. Suppose we have |
that is more intuitive!! I would agree that searching within a dataset Jerome Kelleher notifications@github.com writes:
|
So is the suggestion GET's on non-existent ids and POST searches within non-existent sets 404 while bad filters on existing sets silently return empty sets? We are currently returning 400's and messages like 'The specified callSets are not available in the specified variantSets' when inappropriate filters are applied to make it obvious what's going on. A 400 does seem a little strong, but it's easier to debug. |
I think this seems semantically reasonable @sarahhunt --- I think there are plenty situations where a programmer might search for something and expect to find an empty set of results. I don't think it's an error for a search to produce zero results. (However, I don't think a search should produce zero results when there is an error!) |
Sarah Hunt notifications@github.com writes:
That is my intuition, it's not an error to have a filter that SQL selects that don't match data just return empty sets.
vs |
This sounds fine. When the behaviour is documented, it will be easier to work out why empty results are returned. |
Absolutely agree with 'empty results' behavior rather than a 404 in the case where you've sent a valid query but the result set is empty. |
FWIW here's where we take care of the equivalent blocking-and-tackling (short of the semantic questions discussed above) of defining error responses in our API: https://wiki.dnanexus.com/API-Specification-v1.0.0/Protocols#Errors Then, our individual API methods list the errors they can produce: e.g. https://wiki.dnanexus.com/API-Specification-v1.0.0/GenomicTables#API-method:-/gtable-xxxx/addRows Hope this is helpful as an example. |
The expected error responses from the API need precise definition to allow implementing consistent behavior between server.
The text was updated successfully, but these errors were encountered: