Adjusts #3955, better error message
This commit is contained in:
@@ -414,7 +414,7 @@ export async function computeEditsDiff(
|
|||||||
await access(absolutePath, constants.R_OK);
|
await access(absolutePath, constants.R_OK);
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const errorMessage = error instanceof Error && "code" in error ? `Error code: ${error.code}` : String(error);
|
const errorMessage = error instanceof Error && "code" in error ? `Error code: ${error.code}` : String(error);
|
||||||
return { error: `Could not write file: ${path}. ${errorMessage}.` };
|
return { error: `Could not edit file: ${path}. ${errorMessage}.` };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the file
|
// Read the file
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ export function createEditToolDefinition(
|
|||||||
if (signal) {
|
if (signal) {
|
||||||
signal.removeEventListener("abort", onAbort);
|
signal.removeEventListener("abort", onAbort);
|
||||||
}
|
}
|
||||||
reject(new Error(`Could not write file: ${path}. ${errorMessage}.`));
|
reject(new Error(`Could not edit file: ${path}. ${errorMessage}.`));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user