fix: better error messages for 422

This commit is contained in:
James Houlahan
2020-04-21 13:13:02 +02:00
parent 68d1442a8f
commit 76b480298a
3 changed files with 15 additions and 5 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.ErrNoSuchAPIID {
if _, ok := err.(*pmapi.ErrUnprocessableEntity); ok {
msgLog.WithError(err).Warn("Skipping message update because message exists neither in local DB nor on API")
err = nil
continue