Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

more informative api results when TD api result set is empty #19

Open
boblannon opened this issue May 11, 2015 · 3 comments
Open

more informative api results when TD api result set is empty #19

boblannon opened this issue May 11, 2015 · 3 comments

Comments

@boblannon
Copy link
Contributor

reported by @sckott:

Would be nice if when the APIs fail they give back somewhat useful stuff. For example, here's what happens for the transparency API:

https://gist.github.com/sckott/ba808869da0b60bf7677

@sckott
Copy link

sckott commented May 11, 2015

thanks for addressing this o_0

@boblannon
Copy link
Contributor Author

so the issue here is that we wrote special emitters for streaming data from these endpoints, because the results are potentially very large. that involves sending a "[" and a "200 OK", and then streaming one-record-at-a-time.

the problem is that, for queries like the one you cite, the query takes long enough in postgres that the django app times out during the streaming part, even though it has already sent you a "200 OK" response.

This is a pathological case, and although we'll keep this ticket open, it's possible that this won't be fixed. We're moving towards unifying our data sources (see this blog post), and that means active development on a new API, where we can make the kinds of fundamental decisions that will avoid this circumstance altogether. For the short term, though, "[" is going to have to suffice as an error message. Sorry about that.

@sckott
Copy link

sckott commented May 11, 2015

Okay, Looking forward to the new API !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants