There is a try-catch block and inside the try block an Exception might be thrown. When this exception is thrown it doesn't make sense to continue in execution. I want to log occurrence of this exception into the log too. I do so and then I want to exit the program.
Should I call System.exit(1)
or just call throw e
? Does it even matter? What is "the best practice" here?
try {
...
} catch (Exception e) {
log.error("Wow this is severe! We are done here!", e);
//do I call "throw e" or "System.exit(1)" here?
}