I've caught an exception!! Now what?

后端 未结 16 898
逝去的感伤
逝去的感伤 2021-02-02 05:15

I\'ve started using try-catch blocks (a bit late, I know!), but now I\'m not sure what to do with the exception once I\'ve caught it. What should I do?



        
16条回答
  •  北海茫月
    2021-02-02 05:55

    If don't know how to react to it, don't catch the exception.

    Catch it instead in a place where you have the possibility to handle it and where you know how to continue execution afterwards.

提交回复
热议问题