Task solution#1545
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has critical issues that prevent task completion. The task explicitly requires both success and error handlers for both promises, but promise1 is missing an error handler and promise2 is missing a success handler — each promise currently only has one handler attached. Additionally, there's a typo on line 15: 'Promises was rejected!' should be 'Promise was rejected!' (singular). The Cypress tests are failing because the error message never appears, confirming the handlers aren't properly chained. To fix this, chain both handlers on each promise using either .then(showSuccess).catch(showError) or .then(showSuccess, showError) syntax. Once both handlers are attached to both promises and the typo is corrected, your code should pass the tests.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| }, 3000); | ||
| }); | ||
|
|
||
| promise1.then(showSuccess); |
There was a problem hiding this comment.
Missing error handler for promise1. The task requires adding BOTH success and error handlers to both promises. Use .catch(showError) or .then(showSuccess, showError).
| }); | ||
|
|
||
| promise1.then(showSuccess); | ||
| promise2.catch(showError); |
There was a problem hiding this comment.
Missing success handler for promise2. The task requires adding BOTH success and error handlers to both promises. Use .then(showSuccess) or .then(showSuccess, showError).
| const message = document.createElement('div'); | ||
|
|
||
| message.classList.add('message', 'error-message'); | ||
| message.textContent = 'Promises was rejected!'; |
There was a problem hiding this comment.
Typo: 'Promises was rejected!' should be 'Promise was rejected!' (singular) to match the task requirement exactly.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
All task requirements are met and previous issues have been resolved. Both promise1 and promise2 now have both success and error handlers properly chained using .then(showSuccess).catch(showError), and the error message typo has been corrected to the singular form 'Promise was rejected!'. The implementation is clean and functional.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.