Avoid specifying error type since the default is unknown#4086
Merged
robertbrignull merged 1 commit intomainfrom Jul 23, 2025
Merged
Avoid specifying error type since the default is unknown#4086robertbrignull merged 1 commit intomainfrom
robertbrignull merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates TypeScript catch clauses to leverage the default unknown type introduced in TypeScript 4.4, removing explicit type annotations and replacing instances where any was used with the more type-safe default behavior.
- Removes explicit
: unknowntype annotations from catch clauses since they're now the default - Updates test code to use
getErrorMessage()helper instead of directly accessing.messageproperty on error objects - Improves type safety by avoiding explicit
anytyping in catch blocks
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| variant-analysis-manager.test.ts | Updates test catch blocks to use getErrorMessage() helper and removes explicit any typing |
| errors.test.ts | Removes explicit : unknown annotation from catch clause |
| variant-analysis-manager.ts | Removes explicit : unknown annotation from catch clause |
| model-editor-view.ts | Removes explicit : unknown annotations from multiple catch clauses |
| extension-pack-picker.ts | Removes explicit : unknown annotation from catch clause |
| summary-language-support.ts | Removes explicit : unknown annotation from catch clause |
| skeleton-query-wizard.ts | Removes explicit : unknown annotations from multiple catch clauses |
| extension.ts | Removes explicit : unknown annotation from catch clause |
| db-panel.ts | Removes explicit : unknown annotation from catch clause |
| database-manager.ts | Removes explicit : unknown annotation from catch clause |
| local-databases-ui.ts | Removes explicit : unknown annotation from catch clause |
| short-paths.ts | Removes explicit : unknown annotation from catch clause |
| distribution.ts | Removes explicit : unknown annotation from catch clause |
| update-node-version.ts | Removes explicit : unknown annotation from catch clause |
| source-map.ts | Removes explicit : unknown annotation from catch clause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since typescript 4.4 (release notes), values in a
catchdefault to theunknowntype. So we don't need to specify it, and there were a couple of places where we were explicitly usinganythat would be better off asunknown.Discovered while working on #4056