Skip to content

add task solution#509

Open
timurradkevic wants to merge 2 commits into
mate-academy:masterfrom
timurradkevic:develop
Open

add task solution#509
timurradkevic wants to merge 2 commits into
mate-academy:masterfrom
timurradkevic:develop

Conversation

@timurradkevic

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your implementation has two critical issues that violate explicit task requirements. First, the requirement specifies using console.error() for error reporting, but your code uses console.log(). This applies to all error paths - both the parameter validation error and the callback error. Second, you need to add a check comparing params[0] with params[1] before calling fs.cp - when they are identical, the app must do nothing as stated in the requirements. Without these fixes, your code doesn't meet the specification. Please update both the error logging method and add the same-location comparison logic.


✨ 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 thread src/app.js Outdated
const params = process.argv.slice(2);

if (params.length < 2) {
console.log(new Error('You need to write second parameter'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The requirement explicitly states to throw an error using console.error(), not console.log(). Change console.log to console.error here.

Comment thread src/app.js Outdated
Comment on lines +9 to +10
} else {
fs.cp(params[0], params[1], (error) => console.log(error));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing check for same source and destination. The requirement states the app must do nothing when copying to the same location. You need to compare params[0] with params[1] before calling fs.cp.

Comment thread src/app.js Outdated
if (params.length < 2) {
console.log(new Error('You need to write second parameter'));
} else {
fs.cp(params[0], params[1], (error) => console.log(error));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When an error occurs in the callback, it should be logged using console.error() per the requirements, not console.log().

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary


✨ 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