New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors, path: migrate to use internal/errors.js #11319

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
8 participants
@seppevs
Contributor

seppevs commented Feb 12, 2017

Migrate path.js to use internal/errors.js.

Refs: #11273

cc @jasnell

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

errors,path

Show outdated Hide outdated lib/path.js Outdated

@thefourtheye thefourtheye referenced this pull request Feb 12, 2017

Closed

errors, console: migrate to use internal/errors.js #11308

4 of 4 tasks complete
@thefourtheye

This comment has been minimized.

Show comment
Hide comment
@thefourtheye

thefourtheye Feb 12, 2017

Contributor

Related: #11308 also has an implementation for invalidArgType.

Contributor

thefourtheye commented Feb 12, 2017

Related: #11308 also has an implementation for invalidArgType.

@seppevs

This comment has been minimized.

Show comment
Hide comment
@seppevs

seppevs Feb 13, 2017

Contributor

@thefourtheye : yes, it's the same implementation. Just like in #11300

Contributor

seppevs commented Feb 13, 2017

@thefourtheye : yes, it's the same implementation. Just like in #11300

@jasnell jasnell referenced this pull request Feb 14, 2017

Closed

Tracking Issue: Migrate errors to internal/errors.js #11273

78 of 80 tasks complete

@jasnell jasnell added the blocked label Apr 5, 2017

@seppevs

This comment has been minimized.

Show comment
Hide comment
@seppevs

seppevs May 1, 2017

Contributor

I've just rebased this.

Contributor

seppevs commented May 1, 2017

I've just rebased this.

Show outdated Hide outdated lib/path.js Outdated
@@ -16,7 +16,7 @@ assert.throws(function() {
assert.throws(function() {
fs.watchFile(new Object(), common.noop);
}, /Path must be a string/);
}, common.expectsError({code: 'ERR_INVALID_ARG_TYPE', type: TypeError}));

This comment has been minimized.

@refack

refack May 3, 2017

Member

Could you add an assertion on the message as well?
(Changing the message is semver-major so let's enforce it)

@refack

refack May 3, 2017

Member

Could you add an assertion on the message as well?
(Changing the message is semver-major so let's enforce it)

This comment has been minimized.

@fhinkel

fhinkel May 23, 2017

Member

This is a semver-major change, so it's totally fine to change the message.

@fhinkel

fhinkel May 23, 2017

Member

This is a semver-major change, so it's totally fine to change the message.

This comment has been minimized.

@refack

refack May 23, 2017

Member

Yes, but let's keep it from regressing.

@refack

refack May 23, 2017

Member

Yes, but let's keep it from regressing.

const expectedMessage = common.expectsError({
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError
});

This comment has been minimized.

@refack

refack May 3, 2017

Member

ditto.
(You can turn this into a Factory that takes the messages)

@refack

refack May 3, 2017

Member

ditto.
(You can turn this into a Factory that takes the messages)

@@ -372,7 +372,7 @@ function fail(fn) {
assert.throws(() => {
fn.apply(null, args);
}, TypeError);
}, common.expectsError({code: 'ERR_INVALID_ARG_TYPE', type: TypeError}));

This comment has been minimized.

@refack

refack May 3, 2017

Member

Tritto

@refack

refack May 3, 2017

Member

Tritto

@fhinkel

This comment has been minimized.

Show comment
Hide comment
@fhinkel

fhinkel May 23, 2017

Member

@seppevs Thanks so much for putting this together. Sorry that it is dragging out for so long due to being a semver-major change.

@jasnell Could you take another look? I think your comment has been addressed.

CI: https://ci.nodejs.org/job/node-test-pull-request/8255/

Member

fhinkel commented May 23, 2017

@seppevs Thanks so much for putting this together. Sorry that it is dragging out for so long due to being a semver-major change.

@jasnell Could you take another look? I think your comment has been addressed.

CI: https://ci.nodejs.org/job/node-test-pull-request/8255/

@refack

This comment has been minimized.

Show comment
Hide comment
@refack

refack May 23, 2017

Member

CI: https://ci.nodejs.org/job/node-test-pull-request/8255/

CI failures are infrastructure related.

Member

refack commented May 23, 2017

CI: https://ci.nodejs.org/job/node-test-pull-request/8255/

CI failures are infrastructure related.

@mhdawson

LGTM

{method: 'format', input: [null], message: expectedMessage},
{method: 'format', input: [''], message: expectedMessage},
{method: 'format', input: [true], message: expectedMessage},
{method: 'format', input: [1], message: expectedMessage},

This comment has been minimized.

@mhdawson

mhdawson Jun 6, 2017

Member

We'll need to agree on whether the tests should check the contents of the message or not, but since have landed tests both with and without, I'm fine with landing as is.

@mhdawson

mhdawson Jun 6, 2017

Member

We'll need to agree on whether the tests should check the contents of the message or not, but since have landed tests both with and without, I'm fine with landing as is.

@mhdawson

This comment has been minimized.

Show comment
Hide comment
@mhdawson

mhdawson Jun 6, 2017

Member

@refack I can't quite tell from the comments/discussion if your suggestions have been addressed and you are ok with this landing. It looks like the CI is good and it may be ready to go but I'd like to be sure. Since the CI is also 2 weeks old we probably want to run a new one.

Member

mhdawson commented Jun 6, 2017

@refack I can't quite tell from the comments/discussion if your suggestions have been addressed and you are ok with this landing. It looks like the CI is good and it may be ready to go but I'd like to be sure. Since the CI is also 2 weeks old we probably want to run a new one.

@refack

refack approved these changes Jun 6, 2017

@refack

This comment has been minimized.

Show comment
Hide comment
@refack

refack Jun 6, 2017

Member

We'll need to agree on whether the tests should check the contents of the message or not, but since have landed tests both with and without, I'm fine with landing as is.

@mhdawson Like you said, not worth blocking for full message validation.

Member

refack commented Jun 6, 2017

We'll need to agree on whether the tests should check the contents of the message or not, but since have landed tests both with and without, I'm fine with landing as is.

@mhdawson Like you said, not worth blocking for full message validation.

@mhdawson

This comment has been minimized.

Show comment
Hide comment
@mhdawson

mhdawson Jun 6, 2017

Member

@refack thanks for the quick response. I'll open an issue where we can discuss what we think is the right way to go on the messages and then we can do a second pass to fix up based on what we decide.

New CI run: https://ci.nodejs.org/job/node-test-pull-request/8517/

Member

mhdawson commented Jun 6, 2017

@refack thanks for the quick response. I'll open an issue where we can discuss what we think is the right way to go on the messages and then we can do a second pass to fix up based on what we decide.

New CI run: https://ci.nodejs.org/job/node-test-pull-request/8517/

@mhdawson mhdawson removed the blocked label Jun 6, 2017

@mhdawson

This comment has been minimized.

Show comment
Hide comment
@mhdawson

mhdawson Jun 6, 2017

Member

OSX CI failure looks unrelated. Opened this issue to track: #13507

Member

mhdawson commented Jun 6, 2017

OSX CI failure looks unrelated. Opened this issue to track: #13507

@mhdawson

This comment has been minimized.

Show comment
Hide comment
@mhdawson

mhdawson Jun 6, 2017

Member

CI good so landing.

Member

mhdawson commented Jun 6, 2017

CI good so landing.

@mhdawson

This comment has been minimized.

Show comment
Hide comment
@mhdawson

mhdawson Jun 6, 2017

Member

Landed as dcfbbac

Member

mhdawson commented Jun 6, 2017

Landed as dcfbbac

@mhdawson mhdawson closed this Jun 6, 2017

mhdawson added a commit that referenced this pull request Jun 6, 2017

path: use internal/errors.js
PR-URL: #11319
Ref: #11273
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@refack refack added this to Done in Error Codes Aug 20, 2017

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