I have a program that has to initialize a few big things (connect to a few databases, parse some XML) and without the initialization being successful the program would not be able to continue.
Right now I have my main method throwing just a general Exception
public static void main(String[] args) throws Exception
{
//Throws numerous types of Exceptions
WhateverObject we = WhateverObject.getInstance();
we.doSomething();
}
My question is, is there a better way to handle this? Should I catch the exception and then print out that it failed an exit? Something else maybe? Note, there's no hope of program recovery at this point.