You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
406 B
JavaScript
21 lines
406 B
JavaScript
'use strict';
|
|
|
|
const path = require("path");
|
|
const reportErrors = require("report-errors");
|
|
const mkdirp = require("mkdirp");
|
|
|
|
module.exports = function(errorPath) {
|
|
mkdirp.sync(errorPath);
|
|
|
|
return reportErrors(errorPath, {
|
|
doNotCrash: true,
|
|
handler: (error, context) => {
|
|
console.error("Unhandled error:", error.stack);
|
|
|
|
if (error.rateLimited !== true) {
|
|
process.exit(1);
|
|
}
|
|
}
|
|
});
|
|
};
|