fix(server): error handling for server #112
This commit is contained in:
parent
8092dea9eb
commit
05a712e676
@ -50,6 +50,10 @@ logT('system', 'Free memory:', (os.freemem() / (1024 * 1024)).toFixed(2), 'MB')
|
|||||||
logT('system', 'NodeJS:', process.version)
|
logT('system', 'NodeJS:', process.version)
|
||||||
logT('system', 'Web server')
|
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]
|
const majorVersion = /v?([0-9]+)\.?([0-9]+)?\.?([0-9]+)?\.?([0-9]+)?/.exec(process.version)[1]
|
||||||
if(majorVersion < 8)
|
if(majorVersion < 8)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user