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: use ERR_OUT_OF_RANGE for index errors #22969

Closed
wants to merge 10 commits into from

Conversation

@Trott
Copy link
Member

commented Sep 20, 2018

Remove ERR_INDEX_OUT_OF_RANGE in favor of ERR_OUT_OF_RANGE which is
capable of providing more detail. (In one instance, use
ERR_BUFFER_OUT_OF_BOUNDS which is more accurate in that one instance.)

Updated variable names to match documentation and error messages.

Updated some test cases to only check the error code and type and not the error message which should be subject to change.

h/t @apapirovski for help with troubleshooting C++ compilation errors because...yeah, that's not my strong suit

Labeling semver-major because error code changes are breaking changes. @nodejs/tsc

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
errors: use ERR_OUT_OF_RANGE for index errors
Remove ERR_INDEX_OUT_OF_RANGE in favor of ERR_OUT_OF_RANGE which is
capable of providing more detail. (In one instance, use
ERR_BUFFER_OUT_OF_BOUNDS which is more accurate in that one instance.)
@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2018

Show resolved Hide resolved doc/api/errors.md Outdated
Show resolved Hide resolved doc/api/buffer.md Outdated
Show resolved Hide resolved lib/buffer.js Outdated
Show resolved Hide resolved lib/buffer.js Outdated
Show resolved Hide resolved lib/buffer.js
Show resolved Hide resolved lib/buffer.js Outdated
triggerAsyncId1,
'Async resources having different causal ancestry ' +
'should have different triggerAsyncIds');
triggerAsyncId1);

This comment has been minimized.

Copy link
@BridgeAR

BridgeAR Sep 20, 2018

Member

Nit: this should now fit on a single line.

Show resolved Hide resolved test/parallel/test-buffer-fill.js Outdated

Addressed

Show resolved Hide resolved doc/api/buffer.md Outdated
@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2018

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2018

Removed one of the three error message checks. It's for a message that originates in C++ and appears to vary based on OS. The error code and type are still checked. And there are still two other message checks.

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

@BridgeAR
Copy link
Member

left a comment

LGTM

@lpinca

lpinca approved these changes Sep 20, 2018

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2018

A few test-crypto-keygen failures. Known flaky with a fix being fast-tracked right now.

Resume Build: https://ci.nodejs.org/job/node-test-pull-request/17347/

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2018

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 21, 2018

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2018

@joyeecheung joyeecheung referenced this pull request Sep 25, 2018

Closed

CI failures: 20180925 #17

@Trott

This comment has been minimized.

Copy link
Member Author

commented Sep 27, 2018

Landed in f8d6991

@Trott Trott closed this Sep 27, 2018

Trott added a commit to Trott/io.js that referenced this pull request Sep 27, 2018

errors: use ERR_OUT_OF_RANGE for index errors
Remove ERR_INDEX_OUT_OF_RANGE in favor of ERR_OUT_OF_RANGE which is
capable of providing more detail. (In one instance, use
ERR_BUFFER_OUT_OF_BOUNDS which is more accurate in that one instance.)

PR-URL: nodejs#22969
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.