Permalink
Browse files

do not add json to error on parse error.

  • Loading branch information...
chjj committed Oct 21, 2012
1 parent 1b585dd commit 9f9adfa0f3195f4ad0c0805958bd661e612be60f
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/charged.js
View
@@ -819,7 +819,12 @@ Charged.prototype.request = function(options, callback) {
body = JSON.parse(body);
}
} catch (e) {
- e.message += '\nJSON: "' + body + '"';
+ // For debugging:
+ // e.message += '\nJSON: "' + body + '"';
+ e.message += '\n'
+ + 'The JSON returned from chargify'
+ + ' is failing to parse.'
+ + ' Chargify may be having a problem.';
return callback(e);
}

0 comments on commit 9f9adfa

Please sign in to comment.