Commit 80106e85 by trace

josn 解析错误拦截

parent 183cc78d
...@@ -253,7 +253,12 @@ async function getConfig() { ...@@ -253,7 +253,12 @@ async function getConfig() {
} }
}) })
} else { } else {
dataes = JSON.parse(val.body) try {
dataes = JSON.parse(val.body)
} catch (err) {
errorLog.push(`哪位老哥, 配置文件写错了啊...>>>>>>>>>\n${err}\n<<<<<<<<<\n`)
return
}
let config = dataes.config let config = dataes.config
let subscriber = dataes.subscriber let subscriber = dataes.subscriber
ourApps = dataes.ourApps || {} ourApps = dataes.ourApps || {}
...@@ -649,11 +654,11 @@ function sendEmail(content, to = notifyEmail) { ...@@ -649,11 +654,11 @@ function sendEmail(content, to = notifyEmail) {
return return
} }
console.log(`发送email: ${content.length}`) console.log(`发送email: ${content.length}`)
if (content.indexOf('Error') != -1) { // if (content.indexOf('Error') != -1) {
to = developer // to = developer
} else { // } else {
// to = [...to, 添加只对自己app监控的人] // // to = [...to, 添加只对自己app监控的人]
} // }
let myEmail = 'chaolun.ni@starwin.com' let myEmail = 'chaolun.ni@starwin.com'
let emailTo = to.join(', ') let emailTo = to.join(', ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment