Exception handling try catch inside catch

前端 未结 3 1868
别跟我提以往
别跟我提以往 2020-12-13 17:59

I recently came across code written by a fellow programmer in which he had a try-catch statement inside a catch!

Please forgive my inability to paste the actual code

3条回答
  •  伪装坚强ぢ
    2020-12-13 18:13

    Without knowing what the code does it's impossible to say. But it's not unusual to do this.

    e.g. if you have to clear up resources whilst handling exceptions, that clear-up code itself may have the capability to throw exceptions.

提交回复
热议问题