diff --git a/core/config/promptFile.ts b/core/config/promptFile.ts index 7ebd94435..494220b6a 100644 --- a/core/config/promptFile.ts +++ b/core/config/promptFile.ts @@ -8,12 +8,17 @@ export async function getPromptFiles( ide: IDE, dir: string, ): Promise<{ path: string; content: string }[]> { - const paths = await ide.listWorkspaceContents(dir); - const results = paths.map(async (path) => { - const content = await ide.readFile(path); - return { path, content }; - }); - return Promise.all(results); + try { + const paths = await ide.listWorkspaceContents(dir); + const results = paths.map(async (path) => { + const content = await ide.readFile(path); + return { path, content }; + }); + return Promise.all(results); + } catch (e) { + console.error(e); + return []; + } } export function slashCommandFromPromptFile(