mirror of
https://github.com/matrix-org/dendrite
synced 2025-01-24 10:45:05 +00:00
Report more useful error
This commit is contained in:
parent
4baca2c2a8
commit
cded673af7
1 changed files with 10 additions and 2 deletions
|
@ -112,9 +112,17 @@ func (r *Inputer) processRoomEvent(
|
||||||
// can attempt to reprocess, in case we have learned something new
|
// can attempt to reprocess, in case we have learned something new
|
||||||
// that will allow us to accept the event this time.
|
// that will allow us to accept the event this time.
|
||||||
wasRejected, werr := r.DB.IsEventRejected(ctx, event.EventID())
|
wasRejected, werr := r.DB.IsEventRejected(ctx, event.EventID())
|
||||||
if werr != nil && werr != sql.ErrNoRows {
|
switch {
|
||||||
|
case werr == sql.ErrNoRows:
|
||||||
|
// We haven't seen this event before so continue.
|
||||||
|
case werr != nil:
|
||||||
|
// Something has gone wrong trying to find out if we rejected
|
||||||
|
// this event already.
|
||||||
|
logger.WithError(werr).Errorf("Failed to check if event %q is already seen", event.EventID())
|
||||||
return werr
|
return werr
|
||||||
} else if werr == nil && !wasRejected {
|
case !wasRejected:
|
||||||
|
// We've seen this event before and it wasn't rejected so we
|
||||||
|
// should ignore it.
|
||||||
logger.Debugf("Already processed event %q, ignoring", event.EventID())
|
logger.Debugf("Already processed event %q, ignoring", event.EventID())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue