Putting try catch finally block inside another finally block

前端 未结 5 1115
孤独总比滥情好
孤独总比滥情好 2021-02-07 00:57
 try {
 } catch() {}
 finally {
     try {
     } catch() { }
     finally { }
 }

Is it good to have the code like above?

5条回答
  •  天涯浪人
    2021-02-07 01:26

    Looks ugly but sometimes it's the way to go. Depending on the code consider to extract a method with the second try-catch-finally block.

提交回复
热议问题