Skip to content

Commit

Permalink
add miraigo panic info
Browse files Browse the repository at this point in the history
  • Loading branch information
Sora233 committed Sep 17, 2021
1 parent f24332a commit 5f226b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lsp/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,14 @@ func (l *Lsp) sendGroupMessage(groupCode int64, msg *message.SendingMessage, rec
defer func() {
if e := recover(); e != nil {
if len(recovered) == 0 {
logger.WithField("content", localutils.MsgToString(msg.Elements)).
WithField("stack", string(debug.Stack())).
Errorf("sendGroupMessage panic recovered")
res = l.sendGroupMessage(groupCode, msg, true)
} else {
logger.WithField("content", localutils.MsgToString(msg.Elements)).
WithField("stack", string(debug.Stack())).
Errorf("sendGroupMessage panic recovered %v", e)
Errorf("sendGroupMessage panic recovered but panic again %v", e)
res = &message.GroupMessage{Id: -1, Elements: msg.Elements}
}
}
Expand Down

0 comments on commit 5f226b0

Please sign in to comment.