mileszim/webpurify — pull request #1 by jbergknoff (2014-03-17 16:56:41+00:00)
Title: try/catch around JSON.parse

I've had occasional issues recently where the webpurify service would return HTML documents (server errors) in response to API requests. In those cases, JSON.parse would throw an exception and crash my application. I've added a try/catch around JSON.parse and tried to conform to the existing code (e.g. calling back with a string as an error).