mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 17:01:08 +00:00

The inspector communicates errors via POJOs. This commit wraps the error information in an actual Error object. PR-URL: https://github.com/nodejs/node/pull/26255 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
27 lines
627 B
JavaScript
27 lines
627 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
(async function test() {
|
|
const assert = require('assert');
|
|
const { Session } = require('inspector');
|
|
const { promisify } = require('util');
|
|
|
|
const session = new Session();
|
|
session.connect();
|
|
session.post = promisify(session.post);
|
|
await assert.rejects(
|
|
session.post('Runtime.evaluate', {
|
|
expression: 'for(;;);',
|
|
timeout: 0
|
|
}),
|
|
{
|
|
code: 'ERR_INSPECTOR_COMMAND',
|
|
message: 'Inspector error -32000: Execution was terminated'
|
|
}
|
|
);
|
|
session.disconnect();
|
|
})();
|