mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[eventsub] Suppress error on abnormal closure and reconnect
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
031ad331e4
commit
c3085ea7f9
1 changed files with 4 additions and 0 deletions
|
@ -385,6 +385,10 @@ func (e *EventSubSocketClient) handleSocketError(err error, msgC chan eventSubSo
|
|||
e.logger.Debug("websocket was closed normally")
|
||||
return nil
|
||||
|
||||
case websocket.CloseAbnormalClosure:
|
||||
e.logger.Warn("websocket reported abnormal closure")
|
||||
return errors.Wrap(e.connect(e.socketDest, msgC, errC, "network-error"), "re-connecting after abnormal closure")
|
||||
|
||||
default:
|
||||
// Some non-twitch close code we did not expect
|
||||
e.logger.WithError(closeErr).Error("websocket reported unexpected error code")
|
||||
|
|
Loading…
Reference in a new issue