假设我们有一个像这样的结构:
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
不鼓励使用这种嵌套块,但是我找不到任何具体原因。
这是错误的代码吗?如果是这样,为什么?