Skip to content

Commit cf5c70b

Browse files
committed
chore: catch possible error during update database
1 parent f231b42 commit cf5c70b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

detekt.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ exceptions:
2424
- NumberFormatException
2525
- ParseException
2626
- MissingPropertyException
27+
TooGenericExceptionCaught:
28+
active: false
2729

2830
naming:
2931
excludes: *standardExcludes

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kotlinVersion = "2.1.0"
33
lsp4jVersion = "0.21.2"
44
exposedVersion = "0.58.0"
55
jmhVersion = "1.37"
6+
slf4j = "2.0.16"
67
guavaVersion = "33.4.0-jre"
78
fernFlowerVersion = "243.22562.218"
89

shared/src/main/kotlin/org/javacs/kt/classpath/CachedClassPathResolver.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ internal class CachedClassPathResolver(
116116
LOG.info("Cached classpath is outdated or not found. Resolving again")
117117

118118
val newClasspath = wrapped.classpath
119-
updateClasspathCache(newClasspath, false)
119+
// We need to make sure the cache resolve won't throw error here, make deps can be loaded successfully
120+
try {
121+
// in old exposed this will throw error, but I do not know if it will throw again, so I catch here
122+
updateClasspathCache(newClasspath, false)
123+
} catch (e: Exception) {
124+
LOG.warn("Something error during update database, error: ${e.message}")
125+
}
120126

121127
return newClasspath
122128
}

0 commit comments

Comments
 (0)