Skip to content

Commit 2bcdb18

Browse files
env property name fixed + handling empty response during debugging
1 parent 383172b commit 2bcdb18

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports.methods = {
5252
CONFIG.APPNAME = appname;
5353

5454
if (settings.env) {
55-
body.ConfiguredEnvName = settings.env;
55+
body.ConfiguredEnvironmentName = settings.env;
5656
}
5757

5858
options = helpers.getOptions(CONFIG.IDENTIFY_PATH, body, settings ? settings.proxy : undefined);

lib/debug.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ module.exports = {
3232
},
3333

3434
writeResponse: function (response, close) {
35-
var body = (typeof response.body === 'object') ? JSON.stringify(response.body, null, 4) : response.body,
36-
msg = 'url: ' + response.request.uri.href + ':' + response.request.uri.port + ', method: '
37-
+ response.req.method + ', status: ' + response.statusCode + '\nresponse: ' + body;
35+
var body = response ? response.body : null,
36+
msgBody = (body && typeof body === 'object') ? JSON.stringify(response.body, null, 4) : body,
37+
msg = response ? ('url: ' + response.request.uri.href + ':' + response.request.uri.port + ', method: '
38+
+ response.req.method + ', status: ' + response.statusCode + '\nresponse: ' + msgBody) : 'no data available';
3839
if (close) {
3940
this.close('Response received\n' + msg);
4041
} else {

lib/sender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var http = require('http'),
1717

1818
module.exports.send = function send(options, cb, fail) {
1919
var callback = function (error, response, body) {
20-
debug.writeResponse(response, exc.excCaught);
2120
if (!error) {
21+
debug.writeResponse(response, exc.excCaught);
2222
if (response.statusCode === 200) {
2323
if (cb) {
2424
cb(body);

0 commit comments

Comments
 (0)