add task solution#1538
Conversation
Roma-Yamshchikov
commented
May 13, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Changes are needed to meet the task requirements. The core issue is that the requirement explicitly states both promises must have success AND error handlers, but your current implementation only attaches one handler to each: - promise1 has .then() but is missing .catch() - promise2 has .catch() but is missing .then(). To fix this, attach both handlers to each promise. For example, promise1 should have: promise1.then(/* success /).catch(/ error */); Similarly, chain .then() after promise2's .catch() or use the promise result for the success case. This ensures both promises handle their resolution and rejection paths properly, which is what the task requires. The rest of your implementation—promise creation, DOM manipulation, and the 3-second timeout for promise2—looks correct. Once you add the missing handlers, you'll have a complete solution.
✨ 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
| promise1.then(() => { | ||
| const divEl = document.createElement('div'); | ||
|
|
||
| divEl.classList.add('message'); | ||
| divEl.textContent = 'Promise was resolved!'; | ||
| document.body.append(divEl); | ||
| }); |
There was a problem hiding this comment.
The requirement states both promises need success AND error handlers. Currently only .then() is added - need to also add .catch() to handle errors.
| promise2.catch(() => { | ||
| const divEl = document.createElement('div'); | ||
|
|
||
| divEl.classList.add('message', 'error-message'); | ||
| divEl.textContent = 'Promise was rejected!'; | ||
| document.body.append(divEl); | ||
| }); |
There was a problem hiding this comment.
The requirement states both promises need success AND error handlers. Currently only .catch() is added - need to also add .then() for successful resolution (even though this promise is designed to reject, the handler should still be present per requirements).
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all core functional requirements. Both promise1 and promise2 are properly structured with .then() and .catch() chains attached, click handling works correctly, and the DOM manipulation produces the expected output messages. One improvement to consider: While not blocking, having empty handlers in promise1.catch() and promise2.then() means those code paths don't perform any action. In real applications, even if you don't need to handle a particular case, it's good practice to either add a meaningful fallback (like logging) or add a comment explaining why no action is needed. This demonstrates more complete understanding of promise error handling patterns. The core task functionality is complete and working correctly. Great job on the implementation!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨