![]() |
VOOZH | about |
The process.hasUncaughtExceptionCaptureCallback() method is an inbuilt application programming interface of the process module which is used to get whether a callback has been set using process.setUncaughtExceptionCaptureCallback() method.
Syntax:
process.hasUncaughtExceptionCaptureCallback()
Parameters: This method does not accept any parameters.
Return Value: It returns a boolean value specifying whether a callback has been set using process.setUncaughtExceptionCaptureCallback() or not.
Below examples illustrate the use of process.hasUncaughtExceptionCaptureCallback() method in Node.js:
Example 1:
Output:
false No callback has been set using process.setUncaughtExceptionCaptureCallback() method
Example 2:
Output:
true A callback has been set using process.setUncaughtExceptionCaptureCallback() method
Note: The above program will compile and run by using the node filename.js command.
Reference: https://nodejs.org/api/process.html#process_process_hasuncaughtexceptioncapturecallback