Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Commit

Permalink
Improve robustness of message rule parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ucirello committed Dec 5, 2015
1 parent 3eb6f7b commit 22b5a13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func (s *Self) Process() {
continue
}
go func(self Self, msg messages.Message) {
defer func() {
if r := recover(); r != nil {
log.Printf("panic recovered when parsing message: %#v. Panic: %v", msg, r)
}
}()
for _, rule := range s.rules {
responses := rule.ParseMessage(self, msg)
for _, r := range responses {
Expand Down

0 comments on commit 22b5a13

Please sign in to comment.