summaryrefslogtreecommitdiffstats
path: root/lib/sendgrid.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r--lib/sendgrid.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index be04e96..ebda0cd 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -67,11 +67,11 @@ module.exports = function(api_user, api_key) {
if (json.message !== 'success') {
var error = 'sendgrid error';
if (json.errors) { error = json.errors.shift(); }
- return callback(error, null);
+ return callback(new Error(error), null);
}
return callback(null, json);
- });
+ });
var form = email.toWebFormat();
form['api_user'] = api_user;