refactor: return ErrNoSuchAPIID any time we get 422

This commit is contained in:
James Houlahan
2020-04-17 12:12:44 +02:00
parent 49a64a656c
commit c6f32192b9
5 changed files with 13 additions and 10 deletions

View File

@ -431,7 +431,7 @@ func (loop *eventLoop) processMessages(eventLog *logrus.Entry, messages []*pmapi
msgLog.WithError(err).Warning("Message was not present in DB. Trying fetch...")
if msg, err = loop.apiClient.GetMessage(message.ID); err != nil {
if err == pmapi.ErrNoSuchMessage {
if err == pmapi.ErrNoSuchAPIID {
msgLog.WithError(err).Warn("Skipping message update because message exists neither in local DB nor on API")
err = nil
continue