diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 9a5278989..ca93daf37 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -80,9 +80,15 @@ To read the error message returned by SendGrid's API: request.path = '/v3/mail/send' request.body = requestBody sg.API(request, function (error, response) { - console.log(response.statusCode) - console.log(response.body) - console.log(response.headers) + + if(error) { + console.log(error.message); + console.log(error.response.statusCode); + console.log(error.response.body); + console.log(error.response.headers); + } else { + console.log(response); + } }) ``` diff --git a/package.json b/package.json index 8ca735e15..2b2faa435 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "bottleneck": "^1.12.0", "debug": "^2.2.0", "lodash.chunk": "^4.2.0", - "sendgrid-rest": "^2.2.1" + "sendgrid-rest": "^2.3.0" }, "devDependencies": { "chai": "^3.5.0",