如何使用Intellij Idea的异常断点 [英] How to use Intellij Idea's exception breakpoints
问题描述
这似乎是一个愚蠢的问题,但是我无法弄清楚如何在Intellij Idea中调试异常。谷歌搜索也没有帮助。
我尝试创建异常断点。当IDEA中断时,我希望它给我一个调用堆栈,显示什么导致抛出异常的方法以及自动监视窗口,就像Visual Studio的调试工具一样。相反,它显示关于 Launcher
或 ClassLoader
的各种乱码,但在运行时没有实际异常的迹象。 / p>
那么IDEA的异常断点应该如何使用?
查看断点窗口中,检查任何异常
,但取消选中的标记捕获异常
。启动器和类加载器异常由JVM内部捕获和处理。这样,任何用户异常都将被捕获,无需手动指定异常的类型。
This seems a dumb question, but I can't figure out how to debug exceptions in Intellij Idea. Googling does not help either.
I try to create exception breakpoints. When IDEA breaks, I expect it to give me a call stack showing what leads to the method that throws the exception as well as automatic watch window just like Visual Studio's debugging tool. Instead it shows all kinds of garbled message about Launcher
or ClassLoader
, but no signs of the actual exception during runtime.
So how exactly is IDEA's exception breakpoint supposed to be used?
I finally figured out by myself. In the View Breakpoints
windows, check Any Exception
but uncheck the mark for Caught exception
. The launcher and class loader exceptions are caught and handled internally by the JVM. This way any user exceptions will be caught without manually specifying the type of exception.
这篇关于如何使用Intellij Idea的异常断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!