Conform more of the codebase to strict types (#11191)

This commit is contained in:
Michael Telatynski 2023-07-05 11:53:22 +01:00 committed by GitHub
parent 4044c2aa66
commit 8107f1d271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 88 additions and 57 deletions

View file

@ -178,7 +178,7 @@ export default class MultiInviter {
} catch (err) {
// The error handling during the invitation process covers any API.
// Some errors must to me mapped from profile API errors to more specific ones to avoid collisions.
switch (err.errcode) {
switch (err instanceof MatrixError ? err.errcode : err) {
case "M_FORBIDDEN":
throw new MatrixError({ errcode: "M_PROFILE_UNDISCLOSED" });
case "M_NOT_FOUND":