Best practices: throwing exceptions from properties

后端 未结 8 1928
生来不讨喜
生来不讨喜 2020-11-29 16:18

When is it appropriate to throw an exception from within a property getter or setter? When is it not appropriate? Why? Links to external documents on the subject would be he

8条回答
  •  长情又很酷
    2020-11-29 17:03

    MSDN: Catching and Throwing Standard Exception Types

    http://msdn.microsoft.com/en-us/library/ms229007.aspx

提交回复
热议问题