mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
worker: add missing return value in case of fatal exceptions
This adds a missing return value for the worker specific fatal exception handler. PR-URL: https://github.com/nodejs/node/pull/29036 Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
This commit is contained in:
1 parent
b43d7e8f42
commit
2eae030a4b
1 file changed
+18
-16
+18
-16
@@ -489,23 +489,25 @@ function setupChild(evalScript) {
|
||||
}
|
||||
debug(`[${threadId}] fatal exception caught = ${caught}`);
|
||||
|
||||
if (!caught) {
|
||||
let serialized;
|
||||
try {
|
||||
serialized = serializeError(error);
|
||||
} catch {}
|
||||
debug(`[${threadId}] fatal exception serialized = ${!!serialized}`);
|
||||
if (serialized)
|
||||
port.postMessage({
|
||||
type: messageTypes.ERROR_MESSAGE,
|
||||
error: serialized
|
||||
});
|
||||
else
|
||||
port.postMessage({ type: messageTypes.COULD_NOT_SERIALIZE_ERROR });
|
||||
clearAsyncIdStack();
|
||||
|
||||
process.exit();
|
||||
if (caught) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let serialized;
|
||||
try {
|
||||
serialized = serializeError(error);
|
||||
} catch {}
|
||||
debug(`[${threadId}] fatal exception serialized = ${!!serialized}`);
|
||||
if (serialized)
|
||||
port.postMessage({
|
||||
type: messageTypes.ERROR_MESSAGE,
|
||||
error: serialized
|
||||
});
|
||||
else
|
||||
port.postMessage({ type: messageTypes.COULD_NOT_SERIALIZE_ERROR });
|
||||
clearAsyncIdStack();
|
||||
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user