Skip to content

Solution#1487

Open
dmytro-halieba wants to merge 3 commits intomate-academy:masterfrom
dmytro-halieba:develop
Open

Solution#1487
dmytro-halieba wants to merge 3 commits intomate-academy:masterfrom
dmytro-halieba:develop

Conversation

@dmytro-halieba
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines +26 to +29
promise1.then(() => createMessage('message', 'Promise was resolved!'));

promise2.catch(() =>
createMessage('message error-message', 'Promise was rejected!'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requires adding both success (.then()) and error (.catch()) handlers for both promises.

  • promise1 has a success handler, but it's missing an error handler.
  • promise2 has an error handler, but it's missing a success handler.

Please add the missing handlers to fulfill the requirement.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for promise1 needs to be implemented to display an error message.
  • The .then() handler for promise2 needs 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

setTimeout(() => reject(), 3000);
});

promise1.then(() => createMessage('message', 'Promise was resolved!')).catch();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

promise1.then(() => createMessage('message', 'Promise was resolved!')).catch();

promise2
.then()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants