summaryrefslogtreecommitdiffstats
path: root/lib/sendgrid.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r--lib/sendgrid.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index 9a5ea60..637b6a2 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -91,6 +91,8 @@ var Sendgrid = function(api_user, api_key, options) {
try {
json = JSON.parse(body);
} catch (e) {
+ // be more granular with the error message
+ e.message = e.message + " JSONPARSEERROR when parsing: " + body;
return callback(new Error(e), null);
}