Skip to content

Commit e94b191

Browse files
committed
fix(diff): handle VcsException and log diff before error #51
The `DiffSimplifier` class now includes a logger to capture any errors that occur during the diff calculation process. If an error is thrown, the original diff is logged before the exception is re-thrown, providing more context for debugging purposes.
1 parent 6c0eb94 commit e94b191

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/cc/unitmesh/devti/vcs/DiffSimplifier.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class DiffSimplifier(val project: Project) {
7373

7474
originChanges = writer.toString()
7575
return postProcess(originChanges)
76-
} catch (e: VcsException) {
76+
} catch (e: Exception) {
7777
if (originChanges.isNotEmpty()) {
7878
logger.info("Error calculating diff: $originChanges", e)
7979
}

0 commit comments

Comments
 (0)