|
|
@ -4,11 +4,10 @@ const path = require("path");
|
|
|
|
const reportErrors = require("report-errors");
|
|
|
|
const reportErrors = require("report-errors");
|
|
|
|
const mkdirp = require("mkdirp");
|
|
|
|
const mkdirp = require("mkdirp");
|
|
|
|
|
|
|
|
|
|
|
|
let errorPath = path.join(__dirname, "../errors");
|
|
|
|
module.exports = function(errorPath) {
|
|
|
|
|
|
|
|
mkdirp.sync(errorPath);
|
|
|
|
|
|
|
|
|
|
|
|
mkdirp.sync(errorPath);
|
|
|
|
module.exports = reportErrors(errorPath, {
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = reportErrors(errorPath, {
|
|
|
|
|
|
|
|
doNotCrash: true,
|
|
|
|
doNotCrash: true,
|
|
|
|
handler: (error, context) => {
|
|
|
|
handler: (error, context) => {
|
|
|
|
console.error("Unhandled error", error.stack);
|
|
|
|
console.error("Unhandled error", error.stack);
|
|
|
@ -17,4 +16,5 @@ module.exports = reportErrors(errorPath, {
|
|
|
|
process.exit(1);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|