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>
19 lines
450 B
JavaScript
19 lines
450 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
process.setUncaughtExceptionCaptureCallback(common.mustNotCall());
|
|
|
|
common.expectsError(
|
|
() => require('domain'),
|
|
{
|
|
code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE',
|
|
type: Error,
|
|
message: /^A callback was registered.*with using the `domain` module/
|
|
}
|
|
);
|
|
|
|
process.setUncaughtExceptionCaptureCallback(null);
|
|
|
|
assert.doesNotThrow(() => require('domain'));
|