Remove unhandled rejection tracking
Modern Node.js does this now.
This commit is contained in:
parent
28587c0de2
commit
853b76a881
2 changed files with 0 additions and 19 deletions
|
|
@ -1,17 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
let currentId = 0;
|
|
||||||
const tracker = new WeakMap();
|
|
||||||
|
|
||||||
process.on("unhandledRejection", function (reason, promise) {
|
|
||||||
tracker.set(promise, ++currentId);
|
|
||||||
console.error(`Unhandled rejection (${currentId}): `);
|
|
||||||
console.error(reason.stack);
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on("rejectionHandled", function (promise) {
|
|
||||||
const id = tracker.get(promise);
|
|
||||||
tracker.delete(promise);
|
|
||||||
|
|
||||||
console.error(`Rejection handled (${id})`);
|
|
||||||
});
|
|
||||||
|
|
@ -10,8 +10,6 @@ const convert = require("./convert.js");
|
||||||
const scaffold = require("./scaffold.js");
|
const scaffold = require("./scaffold.js");
|
||||||
const zip = require("./zip.js");
|
const zip = require("./zip.js");
|
||||||
|
|
||||||
require("./track-rejections.js");
|
|
||||||
|
|
||||||
const argv = yargs
|
const argv = yargs
|
||||||
.usage(`${packageJson.description}\n\n${packageJson.name} [<command1> [<command2> [<command3> ...]]]\n\n` +
|
.usage(`${packageJson.description}\n\n${packageJson.name} [<command1> [<command2> [<command3> ...]]]\n\n` +
|
||||||
"Each command will fail if the previously-listed one has not yet been run (with matching options).")
|
"Each command will fail if the previously-listed one has not yet been run (with matching options).")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue