Skip to content

Commit

Permalink
fix(vscode): log localization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Nov 9, 2022
1 parent 9ec5b41 commit e5bc685
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/typescript-explorer-vscode/src/view/typeTreeView.ts
Expand Up @@ -16,7 +16,7 @@ import {
} from "../config"
import { markdownDocumentation } from "../markdown"
import { StateManager } from "../state/stateManager"
import { rangeFromLineAndCharacters } from "../util"
import { logError, rangeFromLineAndCharacters, showError } from "../util"
import { getQuickInfoAtLocation, getTypeTreeAtLocation } from "../server"

const {
Expand Down Expand Up @@ -73,7 +73,13 @@ export class TypeTreeProvider implements vscode.TreeDataProvider<TypeTreeItem> {
}

async getChildren(element?: TypeTreeItem): Promise<TypeTreeItem[]> {
const children = await this.getChildrenWorker(element)
const children = await this.getChildrenWorker(element).catch((e) => {
logError(e, "Error getting children")
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
showError(e.message ?? "Error getting children")
return []
})

this._onDidGetChildren.fire({ parent: element, children })

return children
Expand Down

0 comments on commit e5bc685

Please sign in to comment.