I'm looking for a way to handle errors/crashes, e.g. out of memory, that would typically lead to an "Aw Snap" page in regular Chrome.
Is there handler I can implement this? When testing my application with these types of errors, the screen goes blank (all white) and the following is printed to the terminal.
- Code: Select all
<--- Last few GCs --->
[1:0x55a30aea5ed0] 8357 ms: Scavenge 1883.3 (2057.5) -> 1883.2 (2062.5) MB, 3.2 / 0.0 ms (average mu = 0.798, current mu = 0.668) allocation failure
[1:0x55a30aea5ed0] 8363 ms: Scavenge 1886.1 (2062.5) -> 1886.0 (2063.5) MB, 4.0 / 0.0 ms (average mu = 0.798, current mu = 0.668) allocation failure
[1:0x55a30aea5ed0] 8396 ms: Scavenge 1887.0 (2063.5) -> 1886.9 (2074.5) MB, 32.3 / 0.0 ms (average mu = 0.798, current mu = 0.668) allocation failure
<--- JS stacktrace --->
However, I'm not sure where that output is coming from. Ideally I'd like to either run my own code in this scenario, or if that is not possible, have the application exit with a non-zero exit code.