Skip to content

Commit a9d20a3

Browse files
committed
Fix re-open project exception
1 parent 4343a19 commit a9d20a3

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/kotlin/ai/devchat/common/PathUtils.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ object PathUtils {
1313
fun copyResourceDirToPath(resourceDir: String, outputPath: String) {
1414
val uri = javaClass.getResource(resourceDir)!!.toURI()
1515
val path = if (uri.scheme == "jar") {
16-
val fileSystem = FileSystems.newFileSystem(uri, emptyMap<String, Any>())
16+
val fileSystem = try {
17+
FileSystems.newFileSystem(uri, emptyMap<String, Any>())
18+
} catch (e: FileSystemAlreadyExistsException) {
19+
FileSystems.getFileSystem(uri)
20+
}
1721
fileSystem.getPath("/$resourceDir")
1822
} else {
1923
Paths.get(uri)

src/main/kotlin/ai/devchat/idea/DevChatSetupThread.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DevChatSetupThread : Thread() {
2929
ProjectUtils.executeJS("onInitializationFinish")
3030
DevChatNotifier.info("DevChat initialization has completed successfully.")
3131
} catch (e: Exception) {
32-
Log.error("Failed to install DevChat CLI: " + e.message)
32+
Log.error("Failed to install DevChat CLI: $e\n" + e.stackTrace.joinToString("\n"))
3333
DevChatNotifier.error("DevChat initialization has failed. Please check the logs for more details.")
3434
}
3535
}

0 commit comments

Comments
 (0)