mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
fix(annotate): improve error message for unsupported file types (#870)
- When a file exists but has an unsupported type (.cs, .ts, .py, etc.), show 'File type not supported' instead of misleading 'File not found' - Display supported file types (.md, .mdx, .html, .htm) - Suggest using 'plannotator review' for code files - Maintains backward compatibility for actual missing files Fixes #757 Co-authored-by: ishowman <ishowman@users.noreply.github.com>
This commit is contained in:
@@ -902,7 +902,20 @@ if (args[0] === "sessions") {
|
||||
process.exit(1);
|
||||
}
|
||||
if (resolved.kind === "not_found") {
|
||||
console.error(`File not found: ${resolved.input}`);
|
||||
// Check if file exists but has unsupported type
|
||||
const resolvedPath = resolveUserPath(resolved.input, projectRoot);
|
||||
const fileExists = existsSync(resolvedPath);
|
||||
|
||||
if (fileExists) {
|
||||
const ext = path.extname(resolvedPath).toLowerCase();
|
||||
console.error(
|
||||
`File type not supported: ${ext}\n` +
|
||||
`Only .md, .mdx, .html, .htm files are supported.\n` +
|
||||
`For code review, use: plannotator review [file]`
|
||||
);
|
||||
} else {
|
||||
console.error(`File not found: ${resolved.input}`);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user