5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-09-19 15:49:36 +00:00

Don't treat nil as an unknown type of error (zulip) (#2024)

Fixes #1869
This commit is contained in:
Faye Duxovni 2023-04-03 17:27:00 -04:00 committed by GitHub
parent 5feafcddba
commit 6500714a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,6 +106,7 @@ func (b *Bzulip) getChannel(id int) string {
func (b *Bzulip) handleQueue() error { func (b *Bzulip) handleQueue() error {
for { for {
messages, err := b.q.GetEvents() messages, err := b.q.GetEvents()
if err != nil {
switch err { switch err {
case gzb.BackoffError: case gzb.BackoffError:
time.Sleep(time.Second * 5) time.Sleep(time.Second * 5)
@ -129,7 +130,7 @@ func (b *Bzulip) handleQueue() error {
b.Log.Debugf("receiving error: %#v", err) b.Log.Debugf("receiving error: %#v", err)
time.Sleep(time.Second * 10) time.Sleep(time.Second * 10)
} }
if err != nil {
continue continue
} }
for _, m := range messages { for _, m := range messages {