mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-11 17:03:10 -06:00
Handle non-OK status codes on lookup
This commit is contained in:
parent
a61327eccd
commit
fc058011f1
|
|
@ -194,7 +194,13 @@ func queryIDServerLookup(body *MembershipRequest) (res *idServerLookupResponse,
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
// TODO: Check status code
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
// TODO: Log the error supplied with the identity server?
|
||||
errMgs := fmt.Sprintf("Failed to ask %s to store an invite for %s", body.IDServer, body.Address)
|
||||
return nil, errors.New(errMgs)
|
||||
}
|
||||
|
||||
res = new(idServerLookupResponse)
|
||||
err = json.NewDecoder(resp.Body).Decode(res)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue