Make more of the codebase conform to strict types (#10857)

This commit is contained in:
Michael Telatynski 2023-05-16 14:25:43 +01:00 committed by GitHub
parent 7f017a84c2
commit 6a3f59cc76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 127 additions and 121 deletions

View file

@ -16,6 +16,7 @@ limitations under the License.
import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types";
import { logger } from "matrix-js-sdk/src/logger";
import { HTTPError } from "matrix-js-sdk/src/http-api";
import SdkConfig from "../SdkConfig";
import { MatrixClientPeg } from "../MatrixClientPeg";
@ -39,7 +40,7 @@ export async function doesIdentityServerHaveTerms(fullUrl: string): Promise<bool
terms = await MatrixClientPeg.get().getTerms(SERVICE_TYPES.IS, fullUrl);
} catch (e) {
logger.error(e);
if (e.cors === "rejected" || e.httpStatus === 404) {
if (e.cors === "rejected" || (e instanceof HTTPError && e.httpStatus === 404)) {
terms = null;
} else {
throw e;