fix: return empty result for plans dir when missing

This commit is contained in:
Bohdan Triapitsyn
2026-01-28 12:41:06 +02:00
parent 91e8b9e1f5
commit f7d5df3dee
+4
View File
@@ -6619,6 +6619,10 @@ async function main(options = {}) {
console.error('Failed to list directory:', error);
}
if (code === 'ENOENT') {
// Return empty result for plans directory (expected to not exist until first use)
if (isPlansPath) {
return res.json({ path: resolvedPath || rawPath, entries: [] });
}
return res.status(404).json({ error: 'Directory not found' });
}
if (code === 'EACCES') {