18F / open-data-maker

make it easy to turn a lot of potentially large csv files into easily accessible open data
Other
200 stars 135 forks source link

fix various errors we're seeing in NewRelic #286

Closed ultrasaurus closed 8 years ago

ultrasaurus commented 8 years ago

Fixes #265 & #266, and stops #276 from throwing an exception (but doesn't fully fix it).

Note: the following URLs used to error with stack traces in NewRelic, now have proper json error reporting

{
  "errors": [
    {
      "error": "distance_error",
      "message": "Distance requires zipcode (none given)."
    }
  ]
}
{
  "errors": [
    {
      "error": "zipcode_error",
      "parameter": "zip",
      "input": "000",
      "message": "The provided zipcode, '000', is not valid."   
     }
  ]
}
yozlet commented 8 years ago

Yay! Thank you for tackling this!

What happens if someone supplies zip with no distance?

ultrasaurus commented 8 years ago

@yozlet the zip parameter is ignored if distance isn't given... I suppose we could make an error for that, but I wasn't sure what the intent would have been. If you have thoughts, maybe write separate issue?

ultrasaurus commented 8 years ago

Note: the zip only (no distance) behavior is unchanged with this PR

yozlet commented 8 years ago

Yeah, we can leave the zip checking for the moment.

yozlet commented 8 years ago

:shipit: