fix: don't return error when event data is nil

This commit is contained in:
James Houlahan
2020-04-17 09:09:34 +02:00
committed by Jakub Cuth
parent e1ecc11f38
commit 341a6501e6
7 changed files with 15 additions and 14 deletions

View File

@ -405,8 +405,8 @@ func (loop *eventLoop) processMessages(eventLog *logrus.Entry, messages []*pmapi
msgLog.Debug("Processing EventCreate for message")
if message.Created == nil {
msgLog.Error("Got EventCreate with nil message")
return errors.Wrap(err, "no message to put into DB")
msgLog.Warn("Got EventCreate with nil message")
continue
}
if err = loop.store.createOrUpdateMessageEvent(message.Created); err != nil {
@ -417,8 +417,8 @@ func (loop *eventLoop) processMessages(eventLog *logrus.Entry, messages []*pmapi
msgLog.Debug("Processing EventUpdate(Flags) for message")
if message.Updated == nil {
msgLog.Errorf("Got EventUpdate(Flags) with nil message")
return errors.Wrap(err, "missing update information")
msgLog.Warn("Got EventUpdate(Flags) with nil message")
continue
}
var msg *pmapi.Message

View File

@ -5,8 +5,9 @@
package mocks
import (
gomock "github.com/golang/mock/gomock"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockPanicHandler is a mock of PanicHandler interface

View File

@ -5,9 +5,10 @@
package mocks
import (
gomock "github.com/golang/mock/gomock"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
)
// MockListener is a mock of Listener interface