Do not warn when an AS room alias does not exist

This commit is contained in:
user 2018-08-07 19:50:20 +01:00
parent df432beeb4
commit e0f1e2a033

View file

@ -86,17 +86,20 @@ func (a *AppServiceQueryAPI) RoomAliasExists(
log.WithError(err).Errorf("Issue querying room alias on application service %s", appservice.ID) log.WithError(err).Errorf("Issue querying room alias on application service %s", appservice.ID)
return err return err
} }
if resp.StatusCode == http.StatusOK { switch resp.StatusCode {
// StatusOK received from appservice. Room exists case http.StatusOK:
// OK received from appservice. Room exists
response.AliasExists = true response.AliasExists = true
return nil return nil
case http.StatusNotFound:
// Room does not exist
default:
// Application service reported an error. Warn
log.WithFields(log.Fields{
"appservice_id": appservice.ID,
"status_code": resp.StatusCode,
}).Warn("Application service responded with non-OK status code")
} }
// Log non OK
log.WithFields(log.Fields{
"appservice_id": appservice.ID,
"status_code": resp.StatusCode,
}).Warn("Application service responded with non-OK status code")
} }
} }