Skip to content

tests done#468

Open
DrDakka wants to merge 3 commits intomate-academy:masterfrom
DrDakka:dev
Open

tests done#468
DrDakka wants to merge 3 commits intomate-academy:masterfrom
DrDakka:dev

Conversation

@DrDakka
Copy link

@DrDakka DrDakka commented Jan 9, 2026

No description provided.

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 work on this submission! The core functionality is implemented correctly, and the test suite is particularly impressive for its thoroughness.

However, I'm requesting a small change to align the error handling with the project requirements. In src/app.js, one of the error paths throws an exception, which causes the application to crash. The requirements specify that errors should be logged using console.error().

Please update the try...catch block to use console.error(err) instead of throw err;. This will make the error handling consistent throughout the file and prevent the application from crashing unexpectedly.

Once that's fixed, this will be ready to go!


✨ 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

src/app.js Outdated
}
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;

Choose a reason for hiding this comment

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

According to the task requirements, errors should be reported using console.error(). Throwing the error here causes the application to crash, which is inconsistent with how other errors are handled in this function (e.g., lines 38 and 47). Consider logging the error with console.error() instead.

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 work on addressing the previous feedback and building out the test suite! The error handling is much more robust now.

However, there's one small but important change needed in src/app.js. In the try...catch block that checks the destination path, if an error other than ENOENT occurs (like a permissions issue), the error is logged, but the function doesn't exit. This causes the application to proceed and crash when it tries to call copy(from, to).

To fix this and make the behavior consistent with your other error checks, please add a return; statement after console.error(err); in that block. This will ensure the application exits gracefully in all error scenarios.


✨ 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

}
} catch (err) {
if (err.code !== 'ENOENT') {
console.error(err);

Choose a reason for hiding this comment

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

Nice catch handling non-ENOENT errors here. However, after logging the error, the function proceeds to call copy(from, to). This will likely cause the application to crash if fs.statSync failed due to an issue like permissions. To keep the behavior consistent with other error checks in this function, consider adding a return statement after logging the error.

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! You've successfully addressed the feedback from the previous review by adding the return statement to the final try...catch block. Your application now handles all error cases correctly and meets all the requirements of the task. The code is well-structured and robust, and I am happy to approve your solution.


✨ 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