Skip to content

fs: fix error codes for fs.cp - #41106

Merged
nodejs-github-bot merged 3 commits into
nodejs:masterfrom
aduh95:fs-cp-error-codes
Dec 10, 2021
Merged

fs: fix error codes for fs.cp#41106
nodejs-github-bot merged 3 commits into
nodejs:masterfrom
aduh95:fs-cp-error-codes

Conversation

@aduh95

@aduh95aduh95 commented Dec 7, 2021

Copy link
Copy Markdown
Contributor

The context passed into this error must have .code, .syscall and
.message.

// The context passed into this error must have .code, .syscall and .message,
// and may have .path and .dest.

Maybe it'd worth adding a ESLint rule to catch this kind of mistakes.

Fixes: #41104

The context passed into this error must have `.code`, `.syscall` and
`.message`.
Fixes: nodejs#41104
@nodejs-github-botnodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Dec 7, 2021

@richardlaurichardlau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tests?

@aduh95

aduh95 commented Dec 7, 2021

Copy link
Copy Markdown
ContributorAuthor

Tests?

This only affects the error message, which is usually something we don't test. Or should I add one in test/message anyway?

EDIT: I've added a linter rule instead, PTAL.

@aduh95aduh95 added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Dec 7, 2021
@richardlau

This comment has been minimized.

@richardlau

Copy link
Copy Markdown
Member

Tests?

This only affects the error message, which is usually something we don't test. Or should I add one in test/message anyway?

Does the .code property being added not make it through to the user code outside of the message?

Ah right, I see now. nvm.

@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 7, 2021
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 7, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@BridgeARBridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Checking a single error message might be good for the case that the SystemError implementation would change.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 10, 2021
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 10, 2021
@nodejs-github-bot
nodejs-github-bot merged commit 2f60225 into nodejs:masterDec 10, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 2f60225

danielleadams pushed a commit that referenced this pull request Dec 14, 2021
The context passed into this error must have `.code`, `.syscall` and
`.message`.
Fixes: #41104
PR-URL: #41106
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
The context passed into this error must have `.code`, `.syscall` and
`.message`.
Fixes: #41104
PR-URL: #41106
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
The context passed into this error must have `.code`, `.syscall` and
`.message`.
Fixes: #41104
PR-URL: #41106
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
The context passed into this error must have `.code`, `.syscall` and
`.message`.
Fixes: #41104
PR-URL: #41106
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@danielleadamsdanielleadams mentioned this pull request Feb 1, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.cp throws error with message 'cp returned undefined'

7 participants

@aduh95@richardlau@nodejs-github-bot@evanlucas@Trott@lpinca@BridgeAR