-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
errorsIssues and PRs related to JavaScript errors originated in Node.js core.Issues and PRs related to JavaScript errors originated in Node.js core.
Description
To migrate the errors thrown in C++ land we currently try to collect the context in C++ then throw the actual errors in JS using utilities in internal/errors.js
. The current pattern would replace code like
if (!args.Length() < 1) {
env->ThrowError(...)
}
with
CHECK(args.Length() >= 1);
and enforce the type checks with ->To*(context).ToLocalChecked()
.
The JS layer would do the checks in advance and make sure the bindings are invoked correctly, but if there are people using process.bindings()
with wrong types of objects, previously they got errors, now they would get assersions.
This issues is to make sure we are OK with this path forward. Otherwise we need to somehow port the stuff in internal/errors.js
back to C++ land for migrating those errors.
bnoordhuis and hiroppy
Metadata
Metadata
Assignees
Labels
errorsIssues and PRs related to JavaScript errors originated in Node.js core.Issues and PRs related to JavaScript errors originated in Node.js core.