Is it possible to execute the code in the try block again after an exception in caught in catch block?

后端 未结 7 845
灰色年华
灰色年华 2021-02-05 06:18

I want to execute the code in the try block again after an exception is caught. Is that possible somehow?

For Eg:

try
{
    //execute some code
}
catch(E         


        
7条回答
  •  遇见更好的自我
    2021-02-05 06:47

    already answered in these (and other) links

    Better way to write retry logic without goto

    Cleanest way to write retry logic?

    How can I improve this exception retry scenario?

提交回复
热议问题