Skip to content

Commit 1886569

Browse files
committed
chore: catch possible error during update database
1 parent 0c7ac1b commit 1886569

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-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

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)