fix: Remove try/catch statements without error argument (#6370)

This commit is contained in:
Tom Moor
2024-01-10 08:02:44 -08:00
committed by GitHub
parent 870c623601
commit 22c52f84c5
5 changed files with 8 additions and 8 deletions

View File

@@ -93,7 +93,7 @@ export default class UsersStore extends Store<User> {
try {
this.updateCounts(UserRole.Admin, user.role);
await this.actionOnUser("promote", user);
} catch {
} catch (_e) {
this.updateCounts(user.role, UserRole.Admin);
}
};
@@ -103,7 +103,7 @@ export default class UsersStore extends Store<User> {
try {
this.updateCounts(to, user.role);
await this.actionOnUser("demote", user, to);
} catch {
} catch (_e) {
this.updateCounts(user.role, to);
}
};
@@ -114,7 +114,7 @@ export default class UsersStore extends Store<User> {
this.counts.suspended += 1;
this.counts.active -= 1;
await this.actionOnUser("suspend", user);
} catch {
} catch (_e) {
this.counts.suspended -= 1;
this.counts.active += 1;
}
@@ -126,7 +126,7 @@ export default class UsersStore extends Store<User> {
this.counts.suspended -= 1;
this.counts.active += 1;
await this.actionOnUser("activate", user);
} catch {
} catch (_e) {
this.counts.suspended += 1;
this.counts.active -= 1;
}

View File

@@ -98,7 +98,7 @@ export default class TextHelper {
// Skip attempting to fetch images that are not valid urls
try {
new URL(image.src);
} catch {
} catch (_e) {
return;
}

View File

@@ -15,7 +15,7 @@ export const ProsemirrorSchema = z.custom<TProsemirrorData>((val) => {
const node = Node.fromJSON(schema, val);
node.check();
return true;
} catch {
} catch (_e) {
return false;
}
}, "not valid data");

View File

@@ -10,7 +10,7 @@ function YouTube({ matches, ...props }: Props) {
const url = new URL(props.attrs.href);
const searchParams = new URLSearchParams(url.search);
start = searchParams.get("t")?.replace(/s$/, "");
} catch {
} catch (_e) {
// noop
}

View File

@@ -92,7 +92,7 @@ export default class FileHelper {
height: idhrData.height / pixelRatio,
};
}
} catch {
} catch (_e) {
return undefined;
}