容错
This commit is contained in:
parent
17ae62472e
commit
51a31e4b91
@ -30,16 +30,17 @@ async function connGameLogDB() {
|
|||||||
|
|
||||||
|
|
||||||
process.on('uncaughtException',function(err:Error){
|
process.on('uncaughtException',function(err:Error){
|
||||||
addErrorLog((err.stack).toString());
|
addErrorLog((err?.stack)?.toString());
|
||||||
})
|
})
|
||||||
|
|
||||||
process.on('unhandledRejection', function (err:Error, promise) {
|
process.on('unhandledRejection', function (err:Error, promise) {
|
||||||
addErrorLog((err.stack).toString());
|
addErrorLog((err?.stack)?.toString());
|
||||||
})
|
})
|
||||||
|
|
||||||
async function addErrorLog(errData:any){
|
async function addErrorLog(errData:any){
|
||||||
try{
|
try{
|
||||||
//g123测试版连接不上db,不抓取
|
//g123测试版连接不上db,不抓取
|
||||||
|
if(!errData)return;
|
||||||
if(isG123stg())return;
|
if(isG123stg())return;
|
||||||
let log = {
|
let log = {
|
||||||
serverId : G.config.serverId,
|
serverId : G.config.serverId,
|
||||||
|
Loading…
Reference in New Issue
Block a user