npm / download-counts

Background jobs and a minimal service for collecting and delivering download counts
329 stars 27 forks source link

Providing a invalid date gives a 502 Bad Gateway response #33

Closed mesaugat closed 7 years ago

mesaugat commented 7 years ago

Supposedly, we provide an invalid date for a point or date range. It responds with a 502 response when it actually should be a 400 (Bad Request).

These requests respond with a 502: https://api.npmjs.org/downloads/point/2014-02-35 http://api.npmjs.org/downloads/range/2017-01-45:2018-01-01/uuid

However, this request does throw an invalid date error with a 400 HTTP status code. https://api.npmjs.org/downloads/point/2014-02-035

bcoe commented 7 years ago

@mesaugat we should now be throwing an appropriate error, mind confirming?

mesaugat commented 7 years ago

Works 👍