Skip to content

Commit 32c1299

Browse files
committed
use errorToObject in changes.ts
1 parent 1fe9858 commit 32c1299

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

npm-app/src/utils/changes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fs from 'fs'
22
import path from 'path'
33

44
import { isFileIgnored } from '@codebuff/common/project-file-tree'
5+
import { errorToObject } from '@codebuff/common/util/object'
56
import { applyPatch } from 'diff'
67

78
import type { FileChanges } from '@codebuff/common/actions'
@@ -49,7 +50,11 @@ export function applyChanges(projectRoot: string, changes: FileChanges) {
4950
created.push(filePath)
5051
}
5152
} catch (error) {
52-
console.error(`Failed to apply patch to ${filePath}:`, error, content)
53+
console.error(
54+
`Failed to apply patch to ${filePath}:`,
55+
errorToObject(error),
56+
content,
57+
)
5358
invalid.push(filePath)
5459
}
5560
}

0 commit comments

Comments
 (0)