Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
http_client, errors: migrate to use internal/errors #14423
@starkwang thank you so much for helping with this!
We recently updated the recommended way to test internal Errors — https://github.com/nodejs/node/pull/14207/files
referenced this pull request
Jul 22, 2017
If the error message is not a constant string then tests to validate the formatting of the message based on the parameters used when creating the error should be added to
test/parallel/test-internal-errors.js. These tests should validate all of the different ways parameters can be used to generate the final message string.
And this section:
In addition, there should also be tests which validate the use of the error based on where it is used in the codebase. For these tests, except in special cases, they should only validate that the expected code is received and NOT validate the message.
I don't exactly care about this, just remember that this PR does not strictly comply with these guidelines.
Thanks for your efforts @starkwang!