mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 01:27:14 +00:00

Introduce `process.shouldAbortOnUncaughtException` to control `--abort-on-uncaught-exception` behaviour, and implement some of the domains functionality on top of it. PR-URL: https://github.com/nodejs/node/pull/17159 Refs: https://github.com/nodejs/node/issues/17143 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
23 lines
593 B
JavaScript
23 lines
593 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
common.expectsError(
|
|
() => process.setUncaughtExceptionCaptureCallback(42),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "fn" argument must be one of type Function or null'
|
|
}
|
|
);
|
|
|
|
process.setUncaughtExceptionCaptureCallback(common.mustNotCall());
|
|
|
|
common.expectsError(
|
|
() => process.setUncaughtExceptionCaptureCallback(common.mustNotCall()),
|
|
{
|
|
code: 'ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET',
|
|
type: Error,
|
|
message: /setupUncaughtExceptionCapture.*called while a capture callback/
|
|
}
|
|
);
|