gvsanz

Untitled

Aug 31st, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Notice that there is no error handling for return_promise_2 and return_promise_3.
  2. //
  3. // To add it, we will have to add a second callback in each of the then statements.
  4. return return_promise_1().then(function() {
  5.  
  6.   return return_promise_2().then(function() {
  7.    
  8.     return return_promise_3()
  9.    
  10.   }),
  11.  
  12.   // This function is only executed if return_promise_1 fails.
  13.   function() {
  14.     // Your error handling
  15.   }
  16.      
  17.  })
Advertisement
Add Comment
Please, Sign In to add comment