Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job setting up the promises and handling the resolution and rejection logic! Your solution is very close to complete. However, one of the core requirements is that both promises must have both a success (.then()) and an error (.catch()) handler. Currently, promise1 is missing its .catch() handler, and promise2 is missing its .then() handler. Please add the missing handlers to each promise to fully satisfy the task requirements.
✨ 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
src/scripts/main.js
Outdated
| promise1.then(() => createMessage('message', 'Promise was resolved!')); | ||
|
|
||
| promise2.catch(() => | ||
| createMessage('message error-message', 'Promise was rejected!')); |
There was a problem hiding this comment.
The task requires adding both success (.then()) and error (.catch()) handlers for both promises.
promise1has a success handler, but it's missing an error handler.promise2has an error handler, but it's missing a success handler.
Please add the missing handlers to fulfill the requirement.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great progress on adding the promise handlers! However, this requires a few changes before it can be approved. The task requires that both promises handle success and error cases by appending a message to the body.
Currently, two of the handlers are empty:
- The
.catch()handler forpromise1needs to be implemented to display an error message. - The
.then()handler forpromise2needs to be implemented to display a success message.
Please add the required logic to these handlers to complete the task. You're almost there!
✨ 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
src/scripts/main.js
Outdated
| setTimeout(() => reject(), 3000); | ||
| }); | ||
|
|
||
| promise1.then(() => createMessage('message', 'Promise was resolved!')).catch(); |
There was a problem hiding this comment.
Great job adding the .catch() handler! However, it's currently empty. The task requires that the error handler for both promises appends the error message to the body. Please add the required logic inside this .catch().
src/scripts/main.js
Outdated
| promise1.then(() => createMessage('message', 'Promise was resolved!')).catch(); | ||
|
|
||
| promise2 | ||
| .then() |
There was a problem hiding this comment.
You've correctly added the .then() handler for promise2, but it's also empty. According to the requirements, the success handler for both promises should append the success message. Please implement that logic here.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work! I am happy to approve your solution. You've successfully addressed the feedback from the previous review by implementing all the required promise handlers. The code is now fully functional, clean, and meets all the requirements of the task. Great job on this!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK