Skip to content

Commit fc53fbf

Browse files
NicolappsConvex, Inc.
authored andcommitted
Style: don’t name ignored errors in catch blocks (#42468)
GitOrigin-RevId: 190a4683c37080b140ecac2f2cdeea9250f5cc51
1 parent 03a72f6 commit fc53fbf

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

npm-packages/@convex-dev/codemod/src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export async function hasUncommittedChanges(folder: string) {
66
cwd: folder,
77
});
88
return result.stdout.length > 0;
9-
} catch (error) {
9+
} catch {
1010
return false;
1111
}
1212
}

npm-packages/docs/scripts/pull-component-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function main() {
5858
try {
5959
execSync(`npm run spellcheck`, { stdio: ["inherit", "inherit"] });
6060
console.log(`✅ Spellcheck passed!`);
61-
} catch (error) {
61+
} catch {
6262
console.log(`❌ Spellcheck failed!`);
6363
process.exit(1);
6464
}

npm-packages/js-integration-tests/convex/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ http.route({
7777
let identity: UserIdentity | null | "error" = null;
7878
try {
7979
identity = await auth.getUserIdentity();
80-
} catch (e) {
80+
} catch {
8181
identity = "error";
8282
}
8383

npm-packages/js-integration-tests/convex/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const partialRollback = mutation(async (ctx) => {
113113
await ctx.runMutation(components.component.transact.sendButFail, {
114114
message,
115115
});
116-
} catch (e) {
116+
} catch {
117117
return;
118118
}
119119
throw new Error("expected error");

npm-packages/node-executor/src/syscalls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class SyscallsImpl {
144144
const body = await response.json();
145145
const parsedBody = args.responseValidator.parse(body);
146146
return parsedBody;
147-
} catch (e: any) {
147+
} catch {
148148
// This probably represents an error on our side where we're returning the wrong
149149
// response type, and should ideally never happen. Throw a generic error when
150150
// it does happen though.
@@ -198,7 +198,7 @@ export class SyscallsImpl {
198198
try {
199199
const parsedArgs = argValidator.parse(args);
200200
return parsedArgs;
201-
} catch (e) {
201+
} catch {
202202
throw new Error(
203203
`Invalid ${operationName} request with args ${JSON.stringify(args)}`,
204204
);

npm-packages/udf-runtime/src/23_response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Response {
5353
}
5454
try {
5555
body = JSON.stringify(data);
56-
} catch (e) {
56+
} catch {
5757
throw new TypeError(
5858
"Failed to execute 'json' on 'Response': The data is not JSON serializable",
5959
);

npm-packages/udf-runtime/src/crypto/import_key.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ export function ed25519(
14451445
let privateKeyData;
14461446
try {
14471447
privateKeyData = performOp("crypto/base64UrlDecode", jwk.d);
1448-
} catch (_) {
1448+
} catch {
14491449
throw new DOMException("invalid private key data", "DataError");
14501450
}
14511451

@@ -1468,7 +1468,7 @@ export function ed25519(
14681468
let publicKeyData;
14691469
try {
14701470
publicKeyData = performOp("crypto/base64UrlDecode", jwk.x);
1471-
} catch (_) {
1471+
} catch {
14721472
throw new DOMException("invalid public key data", "DataError");
14731473
}
14741474

0 commit comments

Comments
 (0)