Skip to content

Commit a6b69e6

Browse files
committed
refactor(team-prompts): move file reading inside try block
Moved the file reading operation inside the try block in TeamPromptsBuilder.ts to handle potential errors more effectively.
1 parent dd68971 commit a6b69e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/prompt-manage/team-prompts/TeamPromptsBuilder.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ export class TeamPromptsBuilder {
9191
}
9292

9393
private buildPrompts(promptsDir: string) {
94-
const files = fs.readdirSync(promptsDir);
9594
const prompts: TeamPromptAction[] = [];
9695

9796
try {
97+
const files = fs.readdirSync(promptsDir);
98+
9899
const vmFiles = files.filter(file => file.endsWith('.vm'));
99100

100101
vmFiles.forEach(file => {

0 commit comments

Comments
 (0)