diff --git a/package.json b/package.json index 17eff872..d636663b 100644 --- a/package.json +++ b/package.json @@ -570,8 +570,8 @@ ] }, "scripts": { - "vscode:prepublish": "npm run cleanReadme", - "build": "tsc && gulp webpack-prod", + "vscode:prepublish": "npm run webpack-prod", + "build": "tsc", "cleanReadme": "gulp cleanReadme", "compile": "tsc -watch", "package": "vsce package --githubBranch main", @@ -581,6 +581,7 @@ "pretest": "gulp preTest", "test": "node ./out/test/runTest.js", "webpack": "tsc && gulp webpack-dev", + "webpack-prod": "npm run build && gulp webpack-prod", "webpack-profile": "webpack --profile --json --mode production > webpack-stats.json && echo Use http://webpack.github.io/analyse to analyze the stats", "all": "npm i && npm run lint && npm test", "api-extractor": "tsc -p ./api && api-extractor run -c ./api/api-extractor.json" diff --git a/src/api/compatibility/application/CompatibleApplicationResourceBranchDataProvider.ts b/src/api/compatibility/application/CompatibleApplicationResourceBranchDataProvider.ts index 72ade55b..8dde7e4d 100644 --- a/src/api/compatibility/application/CompatibleApplicationResourceBranchDataProvider.ts +++ b/src/api/compatibility/application/CompatibleApplicationResourceBranchDataProvider.ts @@ -5,7 +5,9 @@ import { AzExtTreeItem, createSubscriptionContext, ISubscriptionContext } from '@microsoft/vscode-azext-utils'; import type { AppResource, AppResourceResolver } from '@microsoft/vscode-azext-utils/hostapi'; +import { l10n } from 'vscode'; import type { AzureResource, ResourceModelBase } from '../../../../api/src/index'; +import { ext } from '../../../extensionVariables'; import { CompatibleBranchDataProviderBase } from '../CompatibleBranchDataProviderBase'; import { CompatibleResolvedApplicationResourceTreeItem } from './CompatibleApplicationResourceTreeItem'; @@ -26,9 +28,12 @@ export class CompatibleApplicationResourceBranchDataProvider { return element.id; diff --git a/src/utils/wrapFunctionsInTelemetry.ts b/src/utils/wrapFunctionsInTelemetry.ts index 0bca6915..e3ff414e 100644 --- a/src/utils/wrapFunctionsInTelemetry.ts +++ b/src/utils/wrapFunctionsInTelemetry.ts @@ -18,9 +18,12 @@ function stringifyError(e: unknown): string { function handleError(e: unknown, functionName: string): never { ext.outputChannel.appendLog(`Internal error: '${functionName}' threw an exception\n\t${stringifyError(e)}`); if (e instanceof Error) { - // shortened message since it might be displayed on the tree - e.message = `Internal error: '${functionName}' threw exception ${parseError(e).message}`; + e.message = functionName === 'branchDataProvider.getResourceItem' ? + // shortened message for anything displayed on the tree + parseError(e).message : + `Internal error: '${functionName}' threw exception ${parseError(e).message}`; } + throw e; }