Spaces:
Build error
Build error
fix: process not quitting on errors
Browse files
backend/functions/src/index.ts
CHANGED
|
@@ -23,5 +23,17 @@ process.on('unhandledRejection', (err) => {
|
|
| 23 |
return;
|
| 24 |
}
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
throw err;
|
| 27 |
});
|
|
|
|
| 23 |
return;
|
| 24 |
}
|
| 25 |
|
| 26 |
+
// Looks like Firebase runtime does not handle error properly.
|
| 27 |
+
// Make sure to quit the process.
|
| 28 |
+
process.nextTick(() => process.exit(1));
|
| 29 |
+
|
| 30 |
+
throw err;
|
| 31 |
+
});
|
| 32 |
+
|
| 33 |
+
process.on('uncaughtException', (err) => {
|
| 34 |
+
// Looks like Firebase runtime does not handle error properly.
|
| 35 |
+
// Make sure to quit the process.
|
| 36 |
+
process.nextTick(() => process.exit(1));
|
| 37 |
+
|
| 38 |
throw err;
|
| 39 |
});
|