简体   繁体   中英

Calling custom functions in Intellij IDEA exception breakpoint conditions

For debugging Kotlin/Java projects in IDEA I am using filters such as !(this instanceof java.lang.ClassNotFoundException) to ignore certain exceptions.

To make these filters easier to maintain and reuse across installations I tried wrapping them in a function and calling that function in the breakpoint condition like:

app.AppKt.isDebugException(this)

This works for exceptions thrown by my local code but breaks with any exceptions thrown by java.lang and third party libraries with a "Breakpoint Condition Error" due to the condition throwing a ClassNotFound exception.

Is there a way to load my AppKt class into IDEA so that the debugging tools will be able to invoke my isDebugException function from anywhere?

The problem here is that your AppKt is not visible from the bootstrap classloader or the third-party libs classloader. No easy solution for now, please follow discussions in IDEA-12111 and related issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM