2017-11-20 19:57:20 +01:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
common.expectsError(
|
|
|
|
() => process.setUncaughtExceptionCaptureCallback(42),
|
|
|
|
{
|
|
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
|
|
type: TypeError,
|
2018-03-19 13:33:46 +01:00
|
|
|
message: 'The "fn" argument must be one of type Function or null. ' +
|
|
|
|
'Received type number'
|
2017-11-20 19:57:20 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
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/
|
|
|
|
}
|
|
|
|
);
|