Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
perf: ⚡️ 微信登出状态下不上报RecvdAPI Error级别错误
Browse files Browse the repository at this point in the history
  • Loading branch information
danni-cool committed Jan 13, 2024
1 parent f1b9c36 commit f45d42d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/route/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ module.exports = function registerLoginCheck({ app, bot }) {
})
})
.on('error', (error) => {
// 报错时接收特殊文本
Service.sendMsg2RecvdApi(
new TextMsg({
text: JSON.stringify({ event: 'error', error, user: currentUser }),
isSystemEvent: true
// 登出后的错误没有必要重复上报
bot.isLoggedIn &&
Service.sendMsg2RecvdApi(
new TextMsg({
text: JSON.stringify({ event: 'error', error, user: currentUser }),
isSystemEvent: true
})
).catch((e) => {
Utils.logger.error('上报 error 事件给 RECVD_MSG_API 出错:', e)
})
).catch((e) => {
Utils.logger.error('上报 error 事件给 RECVD_MSG_API 出错:', e)
})

// 处理异常错误后的登出上报,每次登录成功后掉线只上报一次
if (!logOutWhenError && !bot.isLoggedIn) {
Expand Down

0 comments on commit f45d42d

Please sign in to comment.