Handles an unexpected exception.
try {
throw ex;
} catch (Exception e) {
System.err.println("Unexpected exception : " + e);
System.err.println("Error message is " + ex.getMessage());
System.err.println("*************Stack Trace ************");
e.printStackTrace();
System.exit(0);
}