fix(server): error handling for server #112

This commit is contained in:
Alexey Kasyanchuk 2020-01-07 12:53:44 +03:00
parent 8092dea9eb
commit 05a712e676

View File

@ -50,6 +50,10 @@ logT('system', 'Free memory:', (os.freemem() / (1024 * 1024)).toFixed(2), 'MB')
logT('system', 'NodeJS:', process.version)
logT('system', 'Web server')
// handle promise rejections
process.on('unhandledRejection', r => logTE('system', 'Rejection:', r));
process.on('uncaughtException', (err, origin) => logTE('system', 'Exception:', err, 'Origin:', origin));
const majorVersion = /v?([0-9]+)\.?([0-9]+)?\.?([0-9]+)?\.?([0-9]+)?/.exec(process.version)[1]
if(majorVersion < 8)
{