mirror of
https://github.com/matrix-org/dendrite
synced 2025-01-10 03:58:52 +00:00
More useful errors
This commit is contained in:
parent
1f15cfc6a3
commit
435616b48f
1 changed files with 8 additions and 5 deletions
|
@ -77,7 +77,7 @@ func (r *Queryer) QueryStateAfterEvents(
|
||||||
util.GetLogger(ctx).Errorf("QueryStateAfterEvents: MissingEventError: %s", err)
|
util.GetLogger(ctx).Errorf("QueryStateAfterEvents: MissingEventError: %s", err)
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return err
|
return fmt.Errorf("r.DB.StateAtEventIDs: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response.PrevEventsExist = true
|
response.PrevEventsExist = true
|
||||||
|
@ -88,19 +88,22 @@ func (r *Queryer) QueryStateAfterEvents(
|
||||||
stateEntries, err = roomState.LoadCombinedStateAfterEvents(
|
stateEntries, err = roomState.LoadCombinedStateAfterEvents(
|
||||||
ctx, prevStates,
|
ctx, prevStates,
|
||||||
)
|
)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("roomState.LoadCombinedStateAfterEvents: %w", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Look up the current state for the requested tuples.
|
// Look up the current state for the requested tuples.
|
||||||
stateEntries, err = roomState.LoadStateAfterEventsForStringTuples(
|
stateEntries, err = roomState.LoadStateAfterEventsForStringTuples(
|
||||||
ctx, prevStates, request.StateToFetch,
|
ctx, prevStates, request.StateToFetch,
|
||||||
)
|
)
|
||||||
}
|
if err != nil {
|
||||||
if err != nil {
|
return fmt.Errorf("roomState.LoadStateAfterEventsForStringTuples: %w", err)
|
||||||
return err
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateEvents, err := helpers.LoadStateEvents(ctx, r.DB, stateEntries)
|
stateEvents, err := helpers.LoadStateEvents(ctx, r.DB, stateEntries)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("helpers.LoadStateEvents: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(request.PrevEventIDs) > 1 && len(request.StateToFetch) == 0 {
|
if len(request.PrevEventIDs) > 1 && len(request.StateToFetch) == 0 {
|
||||||
|
|
Loading…
Reference in a new issue