VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-promise-catch-method/

⇱ JavaScript Promise catch() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Promise catch() Method

Last Updated : 23 Jul, 2025

JavaScript Promise catch() method is called whenever a promise is rejected. This method itself returns a promise so it can also be used to chain promises. This method is used for error handling. This method is mainly used after .then to chain a promise and handle reject condition. This method internally calls .then with undefined and rejected conditions as arguments. 

Syntax:

catch(()=>{})

Parameter: This method takes a callback function that decides what action to perform when the promise is rejected

Return Type: This method returns a promise which is in the pending state even if the previous promise is finished.

Example 1: This example uses the catch method to handle the reject condition of a promise.

Output: Since the promise returns a reject it moves to the catch method where the rejected value is received and printed on the console.

Failure

Example 2: This example specifies a condition where the catch method fails to catch an error.

Output: Normally this error should be caught by the catch block but since the error is thrown by an asynchronous function the catch block fails to handle it.

👁 Image
 

Example 3: This method explains the condition when the catch method will not be called.

Output: The catch method is not called as the promise is resolved so only then the method is called.

Equal Values

Supported Browsers: 

  • Google Chrome
  • Mozilla Firefox 
  • Opera 
  • Safari 
  • Edge 

We have a complete list of Javascript Promise methods, to check those please go through the article.

Comment
Article Tags: