开发者

Going back to code while debugging in eclipse

From the createSecureConnection method in my code , 开发者_开发问答i came to exception block

catch (Exception ex) { ex.printStackTrace(); }

Please tell me is it possible to go back to the createSecureConnection from the catch block ??

please see the scren shot here .

http://imageupload.org/?d=8E567A951


you could add a finally block and call it again. but should happen if it fails again?

EDIT:

the finally block is always executed, also if the first call was successful. I'm not sure if this is a good approach, but if you want to do it like this, you have to simply use boolean flag like this:

boolean success = false; 
try{
   ....
   urlc = createSecureConnection(urlString); 
   success = true; 
 }
 catch()
 { ... }
 finally
 { 
    if(!success) try{ createSecureConnection(urlString); }

 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜