Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 1c36ba5

Browse files
author
Matt Loring
committed
Error message when agent is run with node 5.2
Fixes #61
1 parent d946f87 commit 1c36ba5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
var config = require('./config.js');
2323
var logger = require('@google/cloud-diagnostics-common').logger;
2424
var Debuglet = require('./lib/debuglet.js');
25+
var semver = require('semver');
2526

2627
// exports is populated by the agent
2728
module.exports = {};
@@ -36,9 +37,15 @@ if (process.env.hasOwnProperty('GCLOUD_DEBUG_REPO_APP_PATH')) {
3637
process.env.GCLOUD_DEBUG_REPO_APP_PATH;
3738
}
3839

40+
var log = logger.create(config.logLevel, '@google/cloud-debug');
41+
42+
if (semver.satisfies(process.version, '5.2')) {
43+
log.error('Debug is not supported on Node v5.2');
44+
return;
45+
}
46+
3947
if (config.enabled) {
40-
var debuglet = new Debuglet(
41-
config, logger.create(config.logLevel, '@google/cloud-debug'));
48+
var debuglet = new Debuglet(config, log);
4249
debuglet.start();
4350
module.exports.private_ = debuglet;
4451
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"findit": "^2.0.0",
6464
"google-auth-library": "^0.9.5",
6565
"request": "^2.61.0",
66+
"semver": "^5.1.0",
6667
"source-map": "^0.5.1",
6768
"split": "^1.0.0"
6869
}

0 commit comments

Comments
 (0)