|
|
@ -4,17 +4,17 @@ 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, {
|
|
|
|
|
|
|
|
doNotCrash: true,
|
|
|
|
|
|
|
|
handler: (error, context) => {
|
|
|
|
|
|
|
|
console.error("Unhandled error", error.stack);
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = reportErrors(errorPath, {
|
|
|
|
if (error.rateLimited !== true) {
|
|
|
|
doNotCrash: true,
|
|
|
|
process.exit(1);
|
|
|
|
handler: (error, context) => {
|
|
|
|
}
|
|
|
|
console.error("Unhandled error", error.stack);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (error.rateLimited !== true) {
|
|
|
|
|
|
|
|
process.exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|