From bbcc8762e558e59a90dfdd5aeec5ae76f65051e1 Mon Sep 17 00:00:00 2001 From: Emanuele 'Lele' Calo Date: Fri, 21 Dec 2018 20:55:37 +0100 Subject: [PATCH] Minor hints * added .vscode folder to .gitignore * added response body (if present) to .put error text message --- .gitignore | 1 + src/pagerduty.coffee | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e3c015e..7b22d04c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .node-version .idea +.vscode diff --git a/src/pagerduty.coffee b/src/pagerduty.coffee index 4a89bc8e..5e60620b 100644 --- a/src/pagerduty.coffee +++ b/src/pagerduty.coffee @@ -67,7 +67,10 @@ module.exports = switch res.statusCode when 200 then json_body = JSON.parse(body) else - return cb(new PagerDutyError("#{res.statusCode} back from #{url}")) + if body? + return cb(new PagerDutyError("#{res.statusCode} back from #{url} with body: #{body}")) + else + return cb(new PagerDutyError("#{res.statusCode} back from #{url}")) cb null, json_body post: (url, data, cb) ->