Make more of the codebase conform to strict types (#10857)
This commit is contained in:
parent
7f017a84c2
commit
6a3f59cc76
45 changed files with 127 additions and 121 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue