VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-process-hasuncaughtexceptioncapturecallback-method/

⇱ Node.js process.hasUncaughtExceptionCaptureCallback() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js process.hasUncaughtExceptionCaptureCallback() Method

Last Updated : 28 Apr, 2025

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
 

Comment

Explore