improve error message for failed read file tool

This commit is contained in:
Nate 2025-07-23 23:27:34 -07:00
parent 96780f5abf
commit 85ba04a4c7
1 changed files with 3 additions and 1 deletions

View File

@ -10,7 +10,9 @@ export const readFileImpl: ToolImpl = async (args, extras) => {
const firstUriMatch = await resolveRelativePathInDir(filepath, extras.ide);
if (!firstUriMatch) {
throw new Error(`Could not find file ${filepath}`);
throw new Error(
`File "${filepath}" does not exist. You might want to check the path and try again.`,
);
}
const content = await extras.ide.readFile(firstUriMatch);