Skip to content

Commit 3d6e91a

Browse files
committed
fix: handle exceptions consistently in JavaVersionProvider.kt
We've standardized the exception handling in `JavaVersionProvider.kt` by catching `Exception` instead of `Throwable`, ensuring that only relevant exceptions are caught and processed, making the code more robust and maintainable.
1 parent e1b177f commit 3d6e91a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class JavaVersionProvider : ChatContextProvider {
4646

4747
val module: Module = try {
4848
ModuleUtilCore.findModuleForFile(sourceFile)
49-
} catch (e: Throwable) {
49+
} catch (e: Exception) {
5050
return false
5151
} ?: return false
5252

src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewChatAction.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class NewChatAction : DumbAwareAction(), CustomComponentAction {
4545
return@addActionListener
4646
}
4747

48+
// change content displayName AutoDevBundle.message("autodev.chat")
49+
contentManager.contents.forEach {
50+
it.displayName = AutoDevBundle.message("autodev.chat")
51+
}
52+
4853
codingPanel.resetChatSession()
4954
}
5055
}

0 commit comments

Comments
 (0)