本文介绍了在被捕获的异常中抛出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS调试器中,未捕获的异常会导致程序在异常抛出(或足够接近)时断开,并且处于允许您查看所有堆栈帧的状态,并且存在直到该位置的局部变量



有没有办法获得相同的结果(break in throw),但是异常被捕获在特定的点?我没有兴趣为所有的例外,甚至所有的例外,甚至所有的异常(这可能会变得无用的真正快速)这样做,但如果我可以做一个单一的尝试或catch块我会开心



有些相关:




  • (每个类和我正在寻找每个try / catch块)


解决方案

调试 - >例外对话框是否执行您想要的?您可以选择哪些异常会导致VS断开,无论它们是否被捕获。我不知道只有一部分代码才能执行此操作,只能根据引发的异常类型。


In the VS debugger, un-caught exceptions result in the program breaking at the point the exception is throw (or near enough) and in a state that lets you look at all the stack frames and there local variables up to that point.

Is there a way to get this same result (break at throw) but for an exception is caught at a particular point? I'm not interested in doing this for ALL exceptions or even all exception of a given type (that could get useless real quick) but if I could do it for a single try or catch block I'd be happy

somewhat related:

解决方案

Does the Debug -> Exceptions dialog do what you want? You can select which Exceptions that will cause VS to break, regardless of whether they are caught or not. I don't know of a way to do this for only a certain part of the code, only based on the type of the exception thrown.

这篇关于在被捕获的异常中抛出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 12:49