Trying to understand exceptions in C#

前端 未结 7 1732
日久生厌
日久生厌 2020-12-11 21:18

I do not really use any try/catches in my code ever but I\'m trying to break that habit and now get in to using exceptions.

I figure the most important place to have

7条回答
  •  天涯浪人
    2020-12-11 21:50

    "Exceptions are for Exceptional circumstances" - unknown

    Don't use the to essentially pass a message out of a method to the calling method. Always try to gracefully handle things. When something really odd happens then throw an exception. This is something that dev not real familiar with how to use exceptions do a lot.

提交回复
热议问题