Skip to content

Commit d130486

Browse files
author
Jia Liu
committed
feat: should log exception error when bundle failed to set parent
1 parent 5ba2525 commit d130486

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/cc/unitmesh/devti/AutoDevBundle.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cc.unitmesh.devti
22

33
import cc.unitmesh.devti.settings.AutoDevSettingsState
44
import com.intellij.DynamicBundle
5+
import com.intellij.openapi.diagnostic.logger
56
import org.jetbrains.annotations.NonNls
67
import org.jetbrains.annotations.PropertyKey
78
import java.lang.invoke.MethodHandles
@@ -20,6 +21,7 @@ object AutoDevBundle : DynamicBundle(BUNDLE) {
2021
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
2122
getLazyMessage(key, *params)
2223

24+
val log = logger<AutoDevBundle>()
2325
override fun findBundle(
2426
@NonNls pathToBundle: String,
2527
loader: ClassLoader,
@@ -44,8 +46,7 @@ object AutoDevBundle : DynamicBundle(BUNDLE) {
4446
method.isAccessible = true
4547
MethodHandles.lookup().unreflect(method).bindTo(localeBundle).invoke(base)
4648
} catch (e: Throwable) {
47-
// ignored, better handle this in production code
49+
log.error("Failed to set parent", e)
4850
}
4951
}
50-
5152
}

0 commit comments

Comments
 (0)