Multiple try-catch or one?

前端 未结 11 1719

Normally, I\'d do this:

try
{
    code

    code that might throw an anticipated exception you want to handle

    code

    code that might throw an anticip         


        
11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 09:48

    2nd way but ideally use code guards - try/catch can be costly, if you catch an exception.

提交回复
热议问题