diff options
author | Jan Krems <jan.krems@groupon.com> | 2018-05-31 12:21:03 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-06-14 18:46:01 +0200 |
commit | e11447a08b132906d9852e58ccb0433b17f65b0c (patch) | |
tree | 15cd8e5c93aeb6d0da0489f54fce70bb71b19c36 /deps/node-inspect/lib/_inspect.js | |
parent | 7a687624b4b5c7de1a2a33944dc44df76723309a (diff) | |
download | android-node-v8-e11447a08b132906d9852e58ccb0433b17f65b0c.tar.gz android-node-v8-e11447a08b132906d9852e58ccb0433b17f65b0c.tar.bz2 android-node-v8-e11447a08b132906d9852e58ccb0433b17f65b0c.zip |
deps: Upgrade node-inspect to 1.11.5
Removes the prompt to report a bug when trying to launch the
debugger using a port that is already in use.
Changeset generated via:
```
rm -rf deps/node-inspect node-inspect-* && \
curl -sSL "https://github.com/nodejs/node-inspect/archive/v1.11.5.tar.gz" | \
tar -xzvf - && mv node-inspect-* deps/node-inspect
```
PR-URL: https://github.com/nodejs/node/pull/21055
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/node-inspect/lib/_inspect.js')
-rw-r--r-- | deps/node-inspect/lib/_inspect.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/deps/node-inspect/lib/_inspect.js b/deps/node-inspect/lib/_inspect.js index d846efbe6a..305e49915a 100644 --- a/deps/node-inspect/lib/_inspect.js +++ b/deps/node-inspect/lib/_inspect.js @@ -42,6 +42,13 @@ const [ InspectClient, createRepl ] = const debuglog = util.debuglog('inspect'); +class StartupError extends Error { + constructor(message) { + super(message); + this.name = 'StartupError'; + } +} + function portIsFree(host, port, timeout = 2000) { if (port === 0) return Promise.resolve(); // Binding to a random port. @@ -51,7 +58,7 @@ function portIsFree(host, port, timeout = 2000) { return new Promise((resolve, reject) => { setTimeout(() => { didTimeOut = true; - reject(new Error( + reject(new StartupError( `Timeout (${timeout}) waiting for ${host}:${port} to be free`)); }, timeout); @@ -346,10 +353,14 @@ function startInspect(argv = process.argv.slice(2), stdin.resume(); function handleUnexpectedError(e) { - console.error('There was an internal error in node-inspect. ' + - 'Please report this bug.'); - console.error(e.message); - console.error(e.stack); + if (!(e instanceof StartupError)) { + console.error('There was an internal error in node-inspect. ' + + 'Please report this bug.'); + console.error(e.message); + console.error(e.stack); + } else { + console.error(e.message); + } if (inspector.child) inspector.child.kill(); process.exit(1); } |