fix: Remove try/catch statements without error argument (#6370)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export default class FileHelper {
|
||||
height: idhrData.height / pixelRatio,
|
||||
};
|
||||
}
|
||||
} catch {
|
||||
} catch (_e) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user