Add lint rule for unhandled promise rejections
This commit is contained in:
1 parent
ad682d0b69
commit
0b60406b43
14 files changed
+177
-117
No files matched your search
@@ -43,7 +43,7 @@ function exitWorkerGracefully(): void {
|
||||
}
|
||||
|
||||
function exitWorkerUngracefully(): void {
|
||||
extensions.killAll().then(() => {
|
||||
extensions.killAll().finally(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ function exitWorkerGracefully(): void {
|
||||
}
|
||||
|
||||
function exitWorkerUngracefully(): void {
|
||||
extensions.killAll().then(() => {
|
||||
extensions.killAll().finally(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
+4
-2
@@ -45,7 +45,7 @@ function exitWorkerGracefully(): void {
|
||||
}
|
||||
|
||||
function exitWorkerUngracefully(): void {
|
||||
extensions.killAll().then(() => {
|
||||
extensions.killAll().finally(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
@@ -99,7 +99,9 @@ if (!cluster.worker) {
|
||||
|
||||
const _listener = (req, res): void => {
|
||||
if (stopping) res.setHeader("Connection", "close");
|
||||
listener(req, res);
|
||||
listener(req, res).catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
};
|
||||
|
||||
const initPromise = Promise.all([db2.connect(), cache.connect()])
|
||||
|
||||
Reference in new issue
Block a user