yola / pixabayjs

A Javascript Client for the Pixabay API
MIT License
17 stars 6 forks source link

Report the page requested with a bad response #13

Closed LionOps closed 9 years ago

LionOps commented 9 years ago

-- Includes some test cleanup

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

kahnvex commented 9 years ago

What will a consumer use this for?

LionOps commented 9 years ago

A consumer can check the error message, and if the invalid range error, know what page was requested.

kahnvex commented 9 years ago

know what page was requested

Why do they need to know this? Isn't it better to tell them in all requests which page is the last one?

LionOps commented 9 years ago

Why do they need to know this? Isn't it better to tell them in all requests which page is the last one?

Certainly, but the current architecture doesn't support that. The ResultList object would need that information, but after next is called, it's not interacted with again for that request. ResultList next calls the Retriever's get method, and the response is handed to ResponseHandler before given to the consumer.

We agreed it was the consumer's responsibility for handling multiple simultaneous requests. They get back totalHits and would know how many hits there are per page.

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

snitch commented 9 years ago

:sparkles: No lint errors found. :sparkles:

kahnvex commented 9 years ago

:+1: