class TestA implements Runnable {
public void run() {
try {
// do stuff
} catch(Exception e) {
// ...
} finally {
// ...
}
}
}
When an exception occurs, the control comes out of the program. I have 10 files in a for loop to be processed.
When there is an exception in the 2nd file, the remaining 8 files do not get processed. But I want a log to be created for the failure and continue processing the remaining files without terminating. Is there any way to do that? Thanks!!!
Nest your
try/catchlogic inside thefor-loop: