mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Fix 500s on /state
, /state_ids
when state not known (#2672)
This was due to bad error bubbling.
This commit is contained in:
parent
522bd2999f
commit
16156b0b09
4 changed files with 23 additions and 7 deletions
|
@ -329,6 +329,12 @@ func SendJoin(
|
|||
JSON: jsonerror.NotFound("Room does not exist"),
|
||||
}
|
||||
}
|
||||
if !stateAndAuthChainResponse.StateKnown {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusForbidden,
|
||||
JSON: jsonerror.Forbidden("State not known"),
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the user is already in the room. If they're already in then
|
||||
// there isn't much point in sending another join event into the room.
|
||||
|
|
|
@ -135,6 +135,12 @@ func getState(
|
|||
return nil, nil, &resErr
|
||||
}
|
||||
|
||||
if !response.StateKnown {
|
||||
return nil, nil, &util.JSONResponse{
|
||||
Code: http.StatusNotFound,
|
||||
JSON: jsonerror.NotFound("State not known"),
|
||||
}
|
||||
}
|
||||
if response.IsRejected {
|
||||
return nil, nil, &util.JSONResponse{
|
||||
Code: http.StatusNotFound,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue