| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| var msg = `The "${name}" argument must be `; | ||
| if (Array.isArray(expected)) { | ||
| var len = expected.length; | ||
| expected = expected.map((i) => String(i)); |
There was a problem hiding this comment.
Avoid these functional Array methods for performance.
Sorry, something went wrong.
| msg += `. Received ${actual !== null ? typeof actual : 'null'}`; | ||
| } | ||
| return msg; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Missing newline at end of file.
Sorry, something went wrong.
| #### error.port | ||
|
|
||
| * {Number} | ||
| * {number} |
There was a problem hiding this comment.
These kinds of changes should be in a separate commit.
Sorry, something went wrong.
| [try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch | ||
| [V8's stack trace API]: https://github.com/v8/v8/wiki/Stack-Trace-API | ||
| [vm]: vm.html | ||
| [vm]: vm.html No newline at end of file |
There was a problem hiding this comment.
What's this change?
Sorry, something went wrong.
| not capture any frames. | ||
|
|
||
| ### error.message | ||
| #### error.code |
There was a problem hiding this comment.
Why is this being duplicated? error.code already exists below.
Sorry, something went wrong.
| family = 0; | ||
| } else if (typeof callback !== 'function') { | ||
| throw new TypeError('Invalid arguments: callback must be passed'); | ||
| // throw new TypeError('Invalid arguments: callback must be passed'); |
There was a problem hiding this comment.
This needs to be removed.
Sorry, something went wrong.
| err === uv.UV_EAI_NODATA || | ||
| err === uv.UV_EAI_NONAME) { | ||
| err === uv.UV_EAI_NODATA || | ||
| err === uv.UV_EAI_NONAME) { |
There was a problem hiding this comment.
This should be reverted, the conditionals should be lined up.
Sorry, something went wrong.
| hints !== cares.AI_V4MAPPED && | ||
| hints !== (cares.AI_ADDRCONFIG | cares.AI_V4MAPPED)) { | ||
| throw new TypeError('Invalid argument: hints must use valid flags'); | ||
| hints !== cares.AI_ADDRCONFIG && |
There was a problem hiding this comment.
Ditto about reverting the indentation changes.
Sorry, something went wrong.
| (err, servers) => `c-ares failed to set servers: "${err}" [${servers}]`); | ||
| // Add new errors from here... | ||
|
|
||
| // Errors from 111294, port error from 11302 |
There was a problem hiding this comment.
I think 111294 here should be 11294 instead? Also it's a little bit vague about what this comment is referring to, perhaps it can just be removed?
Sorry, something went wrong.
| var msg = `The "${name}" argument must be `; | ||
| if (Array.isArray(expected)) { | ||
| var len = expected.length; | ||
| expected = expected.map((i) => String(i)); |
There was a problem hiding this comment.
Ditto about Array methods.
Sorry, something went wrong.
|
|
||
| if (options.lookup && typeof options.lookup !== 'function') | ||
| throw new TypeError('"lookup" option should be a function'); | ||
| // throw new TypeError('"lookup" option should be a function'); |
There was a problem hiding this comment.
This needs to be removed.
Sorry, something went wrong.
|
the other migrations were done module by module, perhaps this should be two PRs, dns: ... and net: ...? Either way, internals/net isn't a sub-system, its net: . Also, the first commit doesn't follow git commit format guidelines, and the doc change has to be a different PR, its not semver-major, putting it in this PR means it won't be backported. |
Sorry, something went wrong.
|
@sam-github: i was working on dns: and it broke some tests on net: so i ended up migrating that too. about the docs, i should remove from this PR and create a new one dedicated to it, right? |
Sorry, something went wrong.
|
@jasnell was leading the errors stuff, he should weigh in. My suggestion would be to
if dns and net are so intertwined they have to be updated together, then one commit dns, net: .... would be fine instead of seperate net: ... and dns: ... commits. |
Sorry, something went wrong.
|
Please separate the internal errors stuff into a separate pr. I'll be tackling those next week |
Sorry, something went wrong.
|
@jasnell can you clarify how should i proceed with this? i was going to separate the doc from the PR but every other PR in the migration have docs with it, so I am confused About separating internal errors stuff in another PR, you mean internal/net? Even if it breaks the tests? |
Sorry, something went wrong.
|
@sousandrei Can you rebase? Tests should always work after in every single commit. Documentation changes should go with the relevant code changes in 1 PR. PRs that address a different problem or are a separate refactoring should be in a separate PR. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Error codes reused and respective PRs:
#11294
#11302
Ref: #11273
Semver-major because this updates specific error messages and converts errors over to use the new internal/errors.js mechanism.
Checklist
Affected core subsystem(s)
errors, net, dns, doc