Skip to content
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, querystring: migrate to internal/errors.js #11398

Closed
wants to merge 3 commits into from
Closed

errors, querystring: migrate to internal/errors.js #11398

wants to merge 3 commits into from

Conversation

shubheksha
Copy link
Contributor

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

errors, querystring, test

- Add documentation for the error code ERR_MALFORMED_URI
- Add new error code
- Fix failing tests
Replaced functions with arrow functions where ever possible
@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. querystring Issues and PRs related to the built-in querystring module. labels Feb 15, 2017
@shubheksha
Copy link
Contributor Author

@jasnell, I added constructor for URIError used by querystring in errors.js, since one wasn't defined already. Is that the right approach?

@joyeecheung
Copy link
Member

I am probably bikeshedding here, but I am not sure if URIError is the right error type here in the first place, because according to the ECMAScript spec:

19.5.5.6URIError
Indicates that one of the global URI handling functions was used in a way that is incompatible with its definition.

And querystring.parse is not one of the global URI handling functions...In fact not even the WHATWG URL spec would let a routine throw an URIError.

@joyeecheung joyeecheung added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 15, 2017
@jasnell
Copy link
Member

jasnell commented Feb 15, 2017

I tend to agree that URIError likely should not be used here.
@mscdex ... what do you think?

@@ -255,6 +255,13 @@ will affect any stack trace captured *after* the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

#### error.code
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this (and other properties) already added by an older PR?

@mscdex
Copy link
Contributor

mscdex commented Feb 15, 2017

I don't care one way or the other.

@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@fhinkel
Copy link
Member

fhinkel commented May 23, 2017

@jasnell What other error do you suggest?

@shubheksha Do you want to rebase this so we can move forward? Thanks!

@mhdawson
Copy link
Member

mhdawson commented Jun 6, 2017

@shubheksha sorry it took so long to get this reviewed. Are you able to rebase ?

@fhinkel fhinkel added the stalled Issues and PRs that are stalled. label Jun 7, 2017
@mhdawson
Copy link
Member

@shubheksha just wondering if you are able to rebase this or need any help ?

@fhinkel
Copy link
Member

fhinkel commented Jun 28, 2017

I'm closing this because it's been inactive for quite a while. Feel free to reopen or ping a collaborator to get it reopened if needed.

@fhinkel fhinkel closed this Jun 28, 2017
@refack refack reopened this Jul 19, 2017
@refack
Copy link
Contributor

refack commented Jul 19, 2017

I'll follow up

@refack refack self-assigned this Jul 19, 2017
@refack refack removed blocked PRs that are blocked by other issues or PRs. stalled Issues and PRs that are stalled. labels Jul 19, 2017
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Needs some work in the documentation and the test. Otherwise it seems fine.

qs.stringify({ foo: '\udc00' });
}, URIError);
}, common.expectsError('ERR_URI_MALFORMED', URIError, 'URI malformed'));
Copy link
Member

Choose a reason for hiding this comment

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

The expectsError arguments seem to be faulty. Please compare them to other usages or look them up in the function definition.

@BridgeAR
Copy link
Member

Ping @shubheksha are you going to follow up on this? This would require a rebase next to the requested changes.

@BridgeAR
Copy link
Member

Closing this due to long inactivity.

@shubheksha I am sorry this could not land as is. If you would like to pursue this further, please leave a comment or open a new PR.

@BridgeAR BridgeAR closed this Sep 23, 2017
@refack refack removed their assignment Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. querystring Issues and PRs related to the built-in querystring module. semver-major PRs 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.

9 participants