From e7a3d3157966df1f1a13beb5f597a3727dcccfba Mon Sep 17 00:00:00 2001 From: Justin Karneges Date: Tue, 29 Jan 2013 12:22:51 -0800 Subject: if json parse fails, return string object rather than throwing error --- polldance.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/polldance.js b/polldance.js index 48ec1c3..9530986 100644 --- a/polldance.js +++ b/polldance.js @@ -93,8 +93,7 @@ var ErrorTypes = { "TransportError": 0, - "FormatError": 1, - "TimeoutError": 2 + "TimeoutError": 1 }; var TransportTypes = { @@ -296,8 +295,7 @@ try { result = JSON.parse(body); } catch (e) { - this._error(ErrorTypes.FormatError); - return; + result = body; } } this._finished(code, result, headers); -- cgit v1.2.3