mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix error message for when diff fails
This commit is contained in:
parent
7fa399c6af
commit
5900629e6a
1 changed files with 20 additions and 5 deletions
|
|
@ -1106,11 +1106,26 @@ export class Cline {
|
|||
// Construct newContent from diff
|
||||
let newContent: string
|
||||
if (diff) {
|
||||
newContent = await constructNewFileContent(
|
||||
diff,
|
||||
this.diffViewProvider.originalContent || "",
|
||||
!block.partial,
|
||||
)
|
||||
try {
|
||||
newContent = await constructNewFileContent(
|
||||
diff,
|
||||
this.diffViewProvider.originalContent || "",
|
||||
!block.partial,
|
||||
)
|
||||
} catch (error) {
|
||||
await this.say(
|
||||
"error",
|
||||
`Failed to apply changes to ${relPath}. The model's diff instructions could not be processed correctly. This usually happens when the search patterns don't match the file content exactly.`,
|
||||
)
|
||||
pushToolResult(
|
||||
formatResponse.toolError(
|
||||
`Error writing file: ${JSON.stringify(serializeError(error))}`,
|
||||
),
|
||||
)
|
||||
await this.diffViewProvider.revertChanges()
|
||||
await this.diffViewProvider.reset()
|
||||
break
|
||||
}
|
||||
} else if (content) {
|
||||
newContent = content
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue