meritt/node-tumblr — pull request #2 by jesseditson (2012-06-09 02:33:55+00:00)
Title: Fixing JSON parse error being thrown, returning friendlier error message

A non-JSON response would throw an ugly JSON parse error and stack trace would point inside of the module. (encountered this when getting a 404 from tumblr.)

Added try/catch around the json parsing of the response, and returning "Invalid Response" as the error when non-json response is encountered.