diff --git a/lib/internal/debugger/inspect_client.js b/lib/internal/debugger/inspect_client.js index 419b984cc9f473..5c72304ba285c3 100644 --- a/lib/internal/debugger/inspect_client.js +++ b/lib/internal/debugger/inspect_client.js @@ -40,8 +40,8 @@ const kMaskingKeyWidthInBytes = 4; // https://tools.ietf.org/html/rfc6455#section-1.3 const WEBSOCKET_HANDSHAKE_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; -function unpackError({ code, message, data }) { - const err = new ERR_DEBUGGER_ERROR(`${message} - ${data}`); +function unpackError({ code, message }) { + const err = new ERR_DEBUGGER_ERROR(`${message}`); err.code = code; ErrorCaptureStackTrace(err, unpackError); return err; diff --git a/test/sequential/test-debugger-breakpoint-exists.js b/test/sequential/test-debugger-breakpoint-exists.js new file mode 100644 index 00000000000000..7be0ba657fa981 --- /dev/null +++ b/test/sequential/test-debugger-breakpoint-exists.js @@ -0,0 +1,27 @@ +'use strict'; + +const common = require('../common'); + +common.skipIfInspectorDisabled(); + +const fixtures = require('../common/fixtures'); +const startCLI = require('../common/debugger'); + +// Test for "Breakpoint at specified location already exists" error. +{ + const script = fixtures.path('debugger', 'three-lines.js'); + const cli = startCLI([script]); + + function onFatal(error) { + cli.quit(); + throw error; + } + + cli.waitForInitialBreak() + .then(() => cli.waitForPrompt()) + .then(() => cli.command('setBreakpoint(1)')) + .then(() => cli.command('setBreakpoint(1)')) + .then(() => cli.waitFor(/Breakpoint at specified location already exists/)) + .then(() => cli.quit()) + .then(null, onFatal); +}