aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Karneges <justin@affinix.com>2013-01-29 12:22:51 -0800
committerJustin Karneges <justin@affinix.com>2013-01-29 12:22:51 -0800
commite7a3d3157966df1f1a13beb5f597a3727dcccfba (patch)
treef49cf3af37f52583b6f155c327314c5ea5a375b1
parentff764df144e673e8c9a8d78dfc16eda5ce332c22 (diff)
downloadpollymer-e7a3d3157966df1f1a13beb5f597a3727dcccfba.tar
pollymer-e7a3d3157966df1f1a13beb5f597a3727dcccfba.tar.gz
if json parse fails, return string object rather than throwing error
-rw-r--r--polldance.js6
1 files 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);