Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. new Promise(function(resolve, reject) {
  2. //setTimeout(() => resolve(1), 1000);
  3. setTimeout(() => reject(1), 1000);
  4. })
  5.  
  6. .then((result) => {
  7. throw new Error('FAILED_HERE_111! ');
  8. console.log('result111: ', result)
  9. return result + 1;
  10. })
  11. .catch((e) => {
  12. console.log('error111: ', e)
  13. return e + 111;
  14. })
  15.  
  16. .then((result) => {
  17. throw new Error('FAILED_HERE_222! ');
  18. console.log('result222: ', result)
  19. return result + 2;
  20. })
  21. .catch((e) => {
  22. console.log('error222: ', e)
  23. return e + 222;
  24. })
  25.  
  26. .then((result) => {
  27. console.log('result333: ', result)
  28. return result + 3;
  29. })
  30. .catch((e) => {
  31. console.log('error333: ', e)
  32. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement