Skip to content

Commit b34253a

Browse files
fix: add error logging to safeReadDir for non-ENOENT errors
- Log warnings for permission issues or filesystem errors - Only silence ENOENT errors (expected when directory doesn't exist) - Consistent with discoverCategories error handling
1 parent 2e647a8 commit b34253a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/core/registry.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,11 @@ export class WorkflowRegistry {
349349
private async safeReadDir(path: string): Promise<string[] | null> {
350350
try {
351351
return await readdir(path);
352-
} catch {
352+
} catch (error) {
353+
// Only ENOENT (directory doesn't exist) is expected - other errors should be logged
354+
if (error instanceof Error && 'code' in error && error.code !== 'ENOENT') {
355+
console.warn(`Warning: Could not read directory ${path}:`, error);
356+
}
353357
return null;
354358
}
355359
}

0 commit comments

Comments
 (0)