fix(GODT-2653): Only log when err is not nil
This commit is contained in:
@ -353,7 +353,8 @@ func (conn *imapConnector) CreateMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg, literal, err := conn.importMessage(ctx, literal, wantLabelIDs, wantFlags, unread)
|
msg, literal, err := conn.importMessage(ctx, literal, wantLabelIDs, wantFlags, unread)
|
||||||
if err != nil && errors.Is(err, proton.ErrImportSizeExceeded) {
|
if err != nil {
|
||||||
|
if errors.Is(err, proton.ErrImportSizeExceeded) {
|
||||||
// Remap error so that Gluon does not put this message in the recovery mailbox.
|
// Remap error so that Gluon does not put this message in the recovery mailbox.
|
||||||
err = fmt.Errorf("%v: %w", err, connector.ErrMessageSizeExceedsLimits)
|
err = fmt.Errorf("%v: %w", err, connector.ErrMessageSizeExceedsLimits)
|
||||||
}
|
}
|
||||||
@ -363,6 +364,7 @@ func (conn *imapConnector) CreateMessage(
|
|||||||
} else {
|
} else {
|
||||||
logrus.WithError(err).Error("Failed to import message")
|
logrus.WithError(err).Error("Failed to import message")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return msg, literal, err
|
return msg, literal, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user