Skip to content

Commit cc86563

Browse files
Merge pull request #4086 from github/robertbrignull/error-unknown
Avoid specifying error type since the default is unknown
2 parents 1f6749a + bacc3c8 commit cc86563

File tree

15 files changed

+25
-24
lines changed

15 files changed

+25
-24
lines changed

extensions/ql-vscode/scripts/source-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function extractSourceMap() {
131131
resolve(sourceMapsDirectory, `${basename(file)}.map`),
132132
);
133133
rawSourceMaps.set(file, rawSourceMap);
134-
} catch (e: unknown) {
134+
} catch (e) {
135135
// If the file is not found, we will not decode it and not try reading this source map again
136136
if (e instanceof Error && "code" in e && e.code === "ENOENT") {
137137
rawSourceMaps.set(file, null);

extensions/ql-vscode/scripts/update-node-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async function updateNodeVersion() {
9393

9494
// If it exists, we can break out of this loop
9595
break;
96-
} catch (e: unknown) {
96+
} catch (e) {
9797
if (!isExecError(e)) {
9898
throw e;
9999
}

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class ExtensionSpecificDistributionManager {
336336
const distributionStatePath = this.getDistributionStatePath();
337337
try {
338338
this.distributionState = await readJson(distributionStatePath);
339-
} catch (e: unknown) {
339+
} catch (e) {
340340
if (isIOError(e) && e.code === "ENOENT") {
341341
// If the file doesn't exist, that just means we need to create it
342342

extensions/ql-vscode/src/common/short-paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function expandShortPaths(
4545

4646
try {
4747
return await expandShortPathNative(absoluteShortPath, logger);
48-
} catch (e: unknown) {
48+
} catch (e) {
4949
void logger.log(
5050
`Failed to expand short path using native method: ${getErrorMessage(e)}`,
5151
);

extensions/ql-vscode/src/databases/local-databases-ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ export class DatabaseUI extends DisposableObject {
505505
): Promise<void> {
506506
try {
507507
await this.chooseAndSetDatabase(false, progress);
508-
} catch (e: unknown) {
508+
} catch (e) {
509509
void showAndLogExceptionWithTelemetry(
510510
this.app.logger,
511511
this.app.telemetry,

extensions/ql-vscode/src/databases/local-databases/database-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export class DatabaseManager extends DisposableObject {
411411
qlpackStoragePath,
412412
);
413413
await qlPackGenerator.generate();
414-
} catch (e: unknown) {
414+
} catch (e) {
415415
void this.logger.log(
416416
`Could not create skeleton QL pack: ${getErrorMessage(e)}`,
417417
);

extensions/ql-vscode/src/databases/ui/db-panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export class DbPanel extends DisposableObject {
432432
try {
433433
// This will also validate that the controller repository is valid
434434
await getControllerRepo(this.app.credentials);
435-
} catch (e: unknown) {
435+
} catch (e) {
436436
if (e instanceof UserCancellationException) {
437437
return;
438438
}

extensions/ql-vscode/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ async function installOrUpdateThenTryActivate(
667667

668668
try {
669669
await prepareCodeTour(app.commands);
670-
} catch (e: unknown) {
670+
} catch (e) {
671671
void extLogger.log(
672672
`Could not open tutorial workspace automatically: ${getErrorMessage(e)}`,
673673
);

extensions/ql-vscode/src/local-queries/skeleton-query-wizard.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class SkeletonQueryWizard {
132132
// open the query file
133133
try {
134134
await this.openExampleFile();
135-
} catch (e: unknown) {
135+
} catch (e) {
136136
void this.app.logger.log(
137137
`Could not open example query file: ${getErrorMessage(e)}`,
138138
);
@@ -279,7 +279,7 @@ export class SkeletonQueryWizard {
279279
const qlPackGenerator = this.createQlPackGenerator();
280280

281281
await qlPackGenerator.generate();
282-
} catch (e: unknown) {
282+
} catch (e) {
283283
void this.app.logger.log(
284284
`Could not create skeleton QL pack: ${getErrorMessage(e)}`,
285285
);
@@ -299,7 +299,7 @@ export class SkeletonQueryWizard {
299299

300300
this.fileName = await this.determineNextFileName();
301301
await qlPackGenerator.createExampleQlFile(this.fileName);
302-
} catch (e: unknown) {
302+
} catch (e) {
303303
void this.app.logger.log(
304304
`Could not create query example file: ${getErrorMessage(e)}`,
305305
);
@@ -342,7 +342,7 @@ export class SkeletonQueryWizard {
342342
void withProgress(async (progress) => {
343343
try {
344344
await this.downloadDatabase(progress);
345-
} catch (e: unknown) {
345+
} catch (e) {
346346
if (e instanceof UserCancellationException) {
347347
return;
348348
}

extensions/ql-vscode/src/log-insights/summary-language-support.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class SummaryLanguageSupport extends DisposableObject {
113113
const sourceMapText = await readFile(mapPath, "utf-8");
114114
const rawMap: RawSourceMap = JSON.parse(sourceMapText);
115115
this.sourceMap = await new SourceMapConsumer(rawMap);
116-
} catch (e: unknown) {
116+
} catch (e) {
117117
// Error reading sourcemap. Pretend there was no sourcemap.
118118
void extLogger.log(
119119
`Error reading sourcemap file '${mapPath}': ${getErrorMessage(e)}`,

0 commit comments

Comments
 (0)