最佳答案
假设我们有这样一个结构:
Try
' Outer try code, that can fail with more generic conditions,
' that I know less about and might not be able to handle
Try
' Inner try code, that can fail with more specific conditions,
' that I probably know more about, and are likely to handle appropriately
Catch innerEx as Exception
' Handle the inner exception
End Try
Catch outerEx as Exception
' Handle outer exception
End Try
我已经看到了一些意见,嵌套像这样的 Try
块是不鼓励的,但我不能找到任何具体的原因。
这是坏代码吗? 如果是,为什么?