From 85ba04a4c7d8b4db19ffda4a5a6e66678bf534ea Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 23 Jul 2025 23:27:34 -0700 Subject: [PATCH] improve error message for failed read file tool --- core/tools/implementations/readFile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/tools/implementations/readFile.ts b/core/tools/implementations/readFile.ts index a026d0f47..ae8964445 100644 --- a/core/tools/implementations/readFile.ts +++ b/core/tools/implementations/readFile.ts @@ -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);