Better use of console.warn and console.error in dataspace.js

This commit is contained in:
Tony Garnock-Jones 2016-05-13 20:15:20 -04:00
parent 628ba87c54
commit f64491c0a7
1 changed files with 8 additions and 4 deletions

View File

@ -139,10 +139,14 @@ Dataspace.prototype.asChild = function (pid, f, omitLivenessCheck) {
};
Dataspace.prototype.kill = function (pid, exn) {
if (exn && exn.stack) {
console.log("Process exiting", pid, exn, exn.stack);
} else if (exn || Dataspace.noisy) {
console.log("Process exiting", pid, exn);
if (exn) {
if (exn.stack) {
console.error("Process crashed", pid, exn, exn.stack);
} else {
console.error("Process crashed", pid, exn);
}
} else if (Dataspace.noisy) {
console.log("Process exiting", pid);
}
var p = this.processTable.get(pid);
this.processTable = this.processTable.set(pid, { behavior: Dataspace.inertBehavior });