diff --git a/src/github.com/matrix-org/dendrite/clientapi/thirdpartyinvites/thirdpartyinvites.go b/src/github.com/matrix-org/dendrite/clientapi/thirdpartyinvites/thirdpartyinvites.go index 371a3af6f..2d4f56c18 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/thirdpartyinvites/thirdpartyinvites.go +++ b/src/github.com/matrix-org/dendrite/clientapi/thirdpartyinvites/thirdpartyinvites.go @@ -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