开发者

Green Exceptions?

开发者 https://www.devze.com 2022-12-30 11:01 出处:网络
When unhandled exceptions are encountered in VStudio usually the debugger highlights the line YELLOW as the line that threw the exception.

When unhandled exceptions are encountered in VStudio usually the debugger highlights the line YELLOW as the line that threw the exception.

However sometimes I encounter exceptions where the debugger highlights them green as shown:

Green Exceptions?

I've always treated them as normal exceptions, but today I d开发者_运维百科ecided to ask since google/bing produced no results for "Visual Studio Green Exceptions"


The line is highlighted yellow if that is the line that directly threw the exception (typically a throw statement).
It's green if the line is a call to a different function that threw the exception (typically a call to a .Net function that threw an exception).


The yellow line is the line where the exception is really thrown.

The green line indicates a line that is indirectly affected.

I think the screenshot makes it clear. Note that I had to use the "Callstack" window and switch to the Main() method in order to achieve this effect.

Green Exceptions?

0

精彩评论

暂无评论...
验证码 换一张
取 消