Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Need diagnose java program in runtime

I'm working on some program, which doing some manipulations in internet. Program based on Maven, Selenium and Multithread. So now my program is working well, but if proxy not working (or some conclusion is not expected) - my program is down. So I decide to create some diagnosis instrument in runtime of my program for unxpected stuff. I can do it like these:

try{
//blablabla
}catch(Exception e){
//do if something going wrong
}

But what if my browser will be just downloading a page a lot of time? for example, about minute-two? Or unexpected conclusion... Of course, I can use timeouts for selenium and "try/catch", but I want to use it more comfortable. What I want: all code going in the same way as now, but in program runtime every 5-10 seconds is checking some "function diagnosisInRealTime()" and if conditions is equal in diagnosisInRealTime function - my program will be corrected by these function diagnosisInRealTime. Is it possible? Or maybe you know more comfortable way to correct program in real-time?

Comments