reduce log level when deliverying notifications to users without permission (#2912)

This commit is contained in:
Doug Lauder 2022-04-22 13:32:15 -04:00 committed by GitHub
parent ca5f3f65e2
commit cabc15b226
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,11 @@ func (b *Backend) BlockChanged(evt notify.BlockChangeEvent) error {
userID, err := b.deliverMentionNotification(username, extract, evt)
if err != nil {
merr.Append(fmt.Errorf("cannot deliver notification for @%s: %w", username, err))
if errors.Is(err, ErrMentionPermission) {
b.logger.Debug("Cannot deliver notification", mlog.String("user", username), mlog.Err(err))
} else {
merr.Append(fmt.Errorf("cannot deliver notification for @%s: %w", username, err))
}
}
if userID == "" {