File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,7 +143,16 @@ export class SetupViewProvider implements vscode.WebviewViewProvider {
143143 }
144144
145145 private async connectToCodacy ( ) {
146- await codacyAuth ( )
146+ try {
147+ await codacyAuth ( )
148+ this . updateLoginState ( )
149+ this . updateCLIStatus ( )
150+ } catch ( error ) {
151+ Logger . error ( `Failed to connect to Codacy: ${ error instanceof Error ? error . message : 'Unknown error' } ` )
152+ vscode . window . showErrorMessage (
153+ `Failed to connect to Codacy: ${ error instanceof Error ? error . message : 'Unknown error' } `
154+ )
155+ }
147156 }
148157
149158 private updateBadge ( ) {
@@ -198,17 +207,21 @@ export class SetupViewProvider implements vscode.WebviewViewProvider {
198207 private updateMCPStatus ( ) {
199208 if ( this . _view ) {
200209 const isMCPInstalled = isMCPConfigured ( )
201- checkRulesFile ( ) . then ( ( hasInstructionFile ) => {
202- // MCP is complete when installed and has instructions file
203- this . _isMCPComplete = isMCPInstalled && hasInstructionFile
204- this . updateBadge ( )
205-
206- this . _view ?. webview . postMessage ( {
207- type : 'mcpStatusChanged' ,
208- isMCPInstalled,
209- hasInstructionFile,
210+ checkRulesFile ( )
211+ . then ( ( hasInstructionFile ) => {
212+ // MCP is complete when installed and has instructions file
213+ this . _isMCPComplete = isMCPInstalled && hasInstructionFile
214+ this . updateBadge ( )
215+
216+ this . _view ?. webview . postMessage ( {
217+ type : 'mcpStatusChanged' ,
218+ isMCPInstalled,
219+ hasInstructionFile,
220+ } )
221+ } )
222+ . catch ( ( error ) => {
223+ Logger . error ( `Failed to check MCP status: ${ error instanceof Error ? error . message : 'Unknown error' } ` )
210224 } )
211- } )
212225 }
213226 }
214227
Original file line number Diff line number Diff line change 11//@ts -check
22/// <reference lib="dom" />
33
4- /* global acquireVsCodeApi, document, window, console */
4+ /* global acquireVsCodeApi, document, window */
55
66/**
77 * @typedef {Object } VsCodeApi
You can’t perform that action at this time.
0 commit comments