diff --git a/packages/core/src/ide/ide-installer.ts b/packages/core/src/ide/ide-installer.ts index 52dcb6fb4ce..cefb1b05039 100644 --- a/packages/core/src/ide/ide-installer.ts +++ b/packages/core/src/ide/ide-installer.ts @@ -136,8 +136,8 @@ class VsCodeInstaller implements IdeInstaller { ['--install-extension', vsixPath, '--force'], { stdio: 'pipe', - shell: os.platform() === 'win32' && commandPath.endsWith('.cmd') - } + shell: os.platform() === 'win32' && commandPath.endsWith('.cmd'), + }, ); return { success: true, diff --git a/packages/core/src/tools/web-fetch.ts b/packages/core/src/tools/web-fetch.ts index c96cae6ce7f..6c89fe23f87 100644 --- a/packages/core/src/tools/web-fetch.ts +++ b/packages/core/src/tools/web-fetch.ts @@ -145,9 +145,8 @@ ${textContent} llmContent: resultText, returnDisplay: `Content for ${url} processed using fallback fetch.`, }; - } catch (e) { - const error = e as Error; - const errorMessage = `Error during fallback fetch for ${url}: ${error.message}`; + } catch (error: unknown) { + const errorMessage = `Error during fallback fetch for ${url}: ${getErrorMessage(error)}`; return { llmContent: `Error: ${errorMessage}`, returnDisplay: `Error: ${errorMessage}`, diff --git a/packages/core/src/utils/fetch.test.ts b/packages/core/src/utils/fetch.test.ts index 02d7c6f2df4..d00012cc1a8 100644 --- a/packages/core/src/utils/fetch.test.ts +++ b/packages/core/src/utils/fetch.test.ts @@ -91,7 +91,8 @@ describe('fetchWithTimeout', () => { it('should throw FetchError with ETIMEDOUT code when request times out', async () => { // Mock fetch to simulate timeout behavior (fetch as unknown as ReturnType).mockImplementation( - (url: string, options: { signal: AbortSignal }) => new Promise((_, reject) => { + (url: string, options: { signal: AbortSignal }) => + new Promise((_, reject) => { if (options.signal.aborted) { const error = new Error('The operation was aborted'); (error as any).code = 'ABORT_ERR';