I am new to exceptions, haven't covered them in college yet so still learning about them. I tried this and it seems to work, but doesn't seem "right". What's the correct way to try a method again after a exception has been handled?
public static void openCSV(String file) {
FileInputStream fis;
try {
fis = new FileInputStream(file);
} catch (FileNotFoundException e) { //fnf, probably not downloaded yet.
downloadCSV(file); //Download it and try again.
try {
fis = new FileInputStream(file);
} catch (FileNotFoundException e) {
// OK, something else is the problem.
}
}
}