mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
24 lines
569 B
TypeScript
24 lines
569 B
TypeScript
import Logger from '../libs/Logger';
|
|||
|
|
|
||
|
|
import App from '../providers/App';
|
||
|
|
|
||
|
|
class NativeException {
|
||
|
|
|
||
|
|
public process (): void {
|
||
|
|
|
||
|
|
process.on('uncaughtException', exception => {
|
||
|
|
Logger.log('critical', 'Critical error, cleaning up and exiting');
|
||
|
|
Logger.log('critical', exception.stack);
|
||
|
|
|
||
|
|
Logger.log('info', 'Clean up completed, exiting...');
|
||
|
|
process.exit(1);
|
||
|
|
});
|
||
|
|
|
||
|
|
process.on('unhandledRejection', exception => {
|
||
|
|
throw exception;
|
||
|
|
});
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default new NativeException;
|