Ale*_*erl 124 debugging breakpoints exception android-studio
我的Android Studio似乎不希望在默认情况下中断任何异常.启用"Any Exception"中断会在实际的JDE库中启动.有没有办法强制它只在我的代码中的异常中断?
来自Visual Studio Universe,在此处查找默认的VS调试行为.
CJB*_*JBS 190
打破所有异常,抓住或未抓住:
!(this instanceof java.lang.ClassNotFoundException) 
(添加图案)按钮.输入:
com.myapp.* (将其替换为您应用的命名空间前缀)java.* (注意:根据OP的问题,请不要在Java库中断开)android.* (如上所述,省略只调试自己的应用程序代码)
Sco*_*rta 33
如果你打开Breakpoints窗口,它会为你提供很多选项让它有条件地破坏.您正在寻找的是"类过滤器" - 您可以使用例如Java包路径指定通配符表达式,并且它只会因匹配类生成的异常而中断.
打破代码中的所有异常以及未捕获的其他异常:
此方法过滤掉运行时在正常操作期间抛出的异常类型(不是非常特殊,是吗?).它不使用类过滤器,因为它会过滤掉; 代码中的错误通常会导致运行时类抛出异常(例如,访问结束时的数组列表).
启用Java异常断点/任何异常的未捕获的唯一的例外.
添加一个新的Java异常断点的Exception (java.lang)类捕获和未捕获的异常.启用条件并将其设置为:
!(this instanceof java.lang.ClassNotFoundException || this instanceof android.system.ErrnoException || this instanceof java.io.FileNotFoundException || this instanceof javax.net.ssl.SSLHandshakeException || this instanceof javax.net.ssl.SSLPeerUnverifiedException || this instanceof android.system.GaiException || this instanceof java.net.SocketTimeoutException || this instanceof java.net.SocketException || this instanceof java.security.NoSuchAlgorithmException)
Run Code Online (Sandbox Code Playgroud)在条件中添加到您遇到的任何其他非例外情况的排除列表.(顺便说一句,使用java.lang.Exception是一种有效获得第二个"任何例外"条目的方法.)
| 归档时间: |
|
| 查看次数: |
38767 次 |
| 最近记录: |