jedp / kpiggybank

KPI interaction data store
Other
5 stars 6 forks source link

JSON.parse failure for KPI blob should be 400 Bad Request, not 500 Internal Server Error #7

Open jrgm opened 11 years ago

jrgm commented 11 years ago

Maybe a nit but 500 errors should be reserved for "Oh shit. I have no idea what's happening". Fending off bad JSON input should be a 400 error.

See around https://github.com/jedp/kpiggybank/blob/master/lib/server.js#L119

/cc @kparlante, @karlth

jrgm commented 11 years ago

er, I meant @karlht

kparlante commented 11 years ago

Agreed, tracking this on the mozilla fork: https://github.com/mozilla/kpiggybank/issues/10