nomagick commited on
Commit
4b208f4
·
unverified ·
1 Parent(s): 17415ed

fix: process not quitting on errors

Browse files
Files changed (1) hide show
  1. backend/functions/src/index.ts +12 -0
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
  });