mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
[overlays] Reduce socket abnormal closure to warning
resolves TWITCH-BOT-A Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c3085ea7f9
commit
46db72b2cc
1 changed files with 11 additions and 2 deletions
|
@ -405,8 +405,17 @@ func handleSocketSubscription(w http.ResponseWriter, r *http.Request) {
|
|||
case err == nil:
|
||||
// We use nil-error to close the connection
|
||||
|
||||
case errors.As(err, &cErr) && websocket.IsCloseError(cErr, websocket.CloseNormalClosure, websocket.CloseGoingAway):
|
||||
// We don't need to log when the remote closes the websocket gracefully
|
||||
case errors.As(err, &cErr):
|
||||
switch cErr.Code {
|
||||
case websocket.CloseAbnormalClosure:
|
||||
logger.WithError(err).Warn("overlay websocket was closed abnormally")
|
||||
|
||||
case websocket.CloseNormalClosure, websocket.CloseGoingAway:
|
||||
// We don't need to log when the remote closes the websocket gracefully
|
||||
|
||||
default:
|
||||
logger.WithError(err).Error("message processing caused error")
|
||||
}
|
||||
|
||||
default:
|
||||
logger.WithError(err).Error("message processing caused error")
|
||||
|
|
Loading…
Reference in a new issue