Which built-in .NET exceptions can I throw from my application?

后端 未结 5 948
难免孤独
难免孤独 2021-01-30 08:04

If I need to throw an exception from within my application which of the built-in .NET exception classes can I use? Are they all fair game? When should I derive my own?

5条回答
  •  我在风中等你
    2021-01-30 08:45

    I use the ArgumentException (and its “friends”) regularly.

    NotSupportedException and NotImplementedException are also common.

提交回复
热议问题