mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 01:13: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 {
|
if err != nil {
|
||||||
return
|
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)
|
res = new(idServerLookupResponse)
|
||||||
err = json.NewDecoder(resp.Body).Decode(res)
|
err = json.NewDecoder(resp.Body).Decode(res)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue