Skip to content

errors: migrate lib/console - #11340

Closed
mskec wants to merge 1 commit into
nodejs:masterfrom
mskec:errors-console
Closed

errors: migrate lib/console#11340
mskec wants to merge 1 commit into
nodejs:masterfrom
mskec:errors-console

Conversation

@mskec

@mskecmskec commented Feb 13, 2017

Copy link
Copy Markdown
Contributor

Migrate console.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)

@nodejs-github-botnodejs-github-bot added console Issues and PRs related to the console subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Feb 13, 2017
Comment threadlib/console.js Outdated

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.

I'd say just go ahead and write out WRITABLE_STREAM instead of abbreviating

Comment threadlib/internal/errors.js Outdated

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.

Please line wrap at 80 chars

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.

Please use the new common.expectsError() method here.

@mskec

Copy link
Copy Markdown
ContributorAuthor

Thank you for feedback.
Should I add error to docs? documenting new errors

@jasnell

Copy link
Copy Markdown
Member

Yes, please add it to the docs using the pattern seen in the other PRs #11273

@joyeecheung

Copy link
Copy Markdown
Member

This looks like a duplicate of #11308, I've added that one to the tracking issue because that one is earlier.

@mskec

Copy link
Copy Markdown
ContributorAuthor

@joyeecheung yes unfortunately I didn't see it before I started.
I think this PR is done now, but you decide which one you want.

@joyeecheungjoyeecheung added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 14, 2017
@jasnelljasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@fhinkel

Copy link
Copy Markdown
Member

@mskec Thanks so much for putting this together. Sorry that it is dragging out for so long due to being a semver-major change. Could you rebase and also squash your commits (I think all the changes should be one commit, right?). Thanks!

@mskec

Copy link
Copy Markdown
ContributorAuthor

@fhinkel I rebased and squashed commits. Let me know if there is anything else

E('ERR_ARG_NOT_ITERABLE', '%s must be iterable');
E('ERR_ASSERTION', (msg) => msg);
E('ERR_CONSOLE_WRITABLE_STREAM',
(name) => `Console expects a writable stream instance for ${name}`);

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.

Why not use the %s syntax already used by several other format strings?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No special reason. I made this PR when there was no other error messages using %s syntax.
Will change if you think that way is better

@jasnell

Copy link
Copy Markdown
Member

@fhinkel

Copy link
Copy Markdown
Member

Thanks. Landed in 0ecdf29.

@fhinkelfhinkel closed this May 27, 2017
fhinkel pushed a commit that referenced this pull request May 27, 2017
Migrate console.js to use internal/errors.js.
PR-URL: #11340
Ref: #11273
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@TrottTrott removed the blocked PRs that are blocked by other issues or PRs. label Jul 11, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consoleIssues and PRs related to the console subsystem.errorsIssues and PRs related to JavaScript errors originated in Node.js core.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@mskec@jasnell@joyeecheung@fhinkel@TimothyGu@refack@Trott@nodejs-github-bot