Skip to content

Commit fb5f129

Browse files
authored
fix(newrelic): update monitor_script.js (#497)
1 parent 0b4f94a commit fb5f129

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/newrelic/monitor_script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $http.get({
3737
}
3838
let status = {};
3939
try {
40-
status = JSON.parse(body);
40+
status = typeof body === 'string' ? JSON.parse(body) : body;
4141
} catch (e) {
4242
assert.fail(new Error(`Error parsing body of ${url}: ${body}`));
4343
}
@@ -55,7 +55,7 @@ $http.get({
5555
$util.insights.set('errorURL', status.error.url);
5656
}
5757
if (status.status !== 'OK') {
58-
console.error(body);
58+
console.error(status);
5959
}
6060

6161
assert.equal(status.status, 'OK', `Expected an OK health check status, got: ${status.status}`);

0 commit comments

Comments
 (0)