List of exceptions that CAN'T be caught in .NET

前端 未结 8 1231
忘掉有多难
忘掉有多难 2020-11-30 09:16

What is the list of exceptions that CAN\'T be caught in .NET? Or where can I find such a list?

相关标签:
8条回答
  • 2020-11-30 09:28

    Any exception that you can't reference by type because of accessibility can't be explicitly caught, but can be caught using the base Exception type.

    For example, a ContractException in the code contracts framework is purposely made internal to its assembly so that you can't try to catch it explicitly.

    0 讨论(0)
  • 2020-11-30 09:43

    SEHException can't be caught in some cases. It can be thrown by unmanaged code. A great SO thread on this topic appears here: SEHException not caught by Try/Catch

    0 讨论(0)
提交回复
热议问题