-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improper error response if unsupported format is requested #203
Comments
Just a comment since I know some of you participate in spec meetings, there doesn't seem to be any way to ask a server what output formats it supports for a given ID. I realize there are only 2 possible for reads, but that is more than 1 and clients should be able to know before requesting a particular format. |
I think that this issue stems from the following S3 path confusion, so I just went and created a
You'll see that our server behaves as expected in this situation:
And to your point:
From my point of view, the
If I understand correctly, you'd want a hint for clients when an ID with multiple formats is found within the storage backend? As in, some draft behavior like the following?:
And then have a HTTP 302 or 303 code to redirect the client to BAM automatically as it does now by default? That way clients would have that hint and not break backwards compat? Happy to propose it on hts spec if that's what you need/want, @jrobinso? |
I agree with @brainstorm here. I'm not sure that I also think this interpretation (the currently implemented one) aligns more closely with the HTTP status codes that Either way, I can see the utility of having a hint for the formats that are available for a particular id. This doesn't necessarily need a spec change either, and it could just be present in the error response (whether that is {
"htsget": {
"error": "NotFound",
"message": "id with key: `cram/mt.sorted_cram.bam` not found. The following formats are available for this id: ['BAM']"
}
} |
Somewhat related to this (although not directly) is #127. |
Well, I slightly disagree here: I'm not sure that |
Yeah that's a completely valid point. A hint would probably be best as an additional JSON field, which would require a spec change. |
OK I will defer to you guys, I misinterpreted the spec. For my part I've updated the igv.js doc to be clear that CRAM and BCF are not supported for htsget. This is also true of IGV desktop as the htsjdk does not support them. |
The following request
results in the following response
According to the spec
The server SHOULD reply with an UnsupportedFormat error if the requested format is not supported.
I realize it says SHOULD so this behavior isn't technically out of spec, but it can result in confusing error messages to client programs and their users. It doesn't appear that htsjdk supports decoding CRAM from htsget responses, so I was testing to see what happens if BAM is requested. I think some servers could handle either BAM or CRAM output for the same dataset ID, but other cannot (such as this particular test server). So its difficult to present an informative error message to end users without the specific error called for in the spec.
The text was updated successfully, but these errors were encountered: