Rewrite AppDomain to handle uncaughts & promises

This commit is contained in:
2022-04-06 13:51:04 +09:00
parent 7dedaf8d77
commit 5674f3936c
9 changed files with 137 additions and 91 deletions
+13 -1
View File
@@ -133,7 +133,19 @@ class Dragonfly
else
{
// Send to master to prevent multiple process competing to write into the handler
this.logHandler = { write: function( e ) { process.send({ cmd: "dragonLog", data: e }); } };
this.logHandler = {
write: function( e ) {
process.send(
{ cmd: "dragonLog", data: e }
, ( er ) => {
if( er )
{
console.log( er.code, e );
}
}
);
}
};
}
var tag = cluster.isMaster ? "M" : "S";