Use getMessage()
method of exeption type variable.
String errorMessage = null;
try {
throw(new Exception("Let's throw some exception message here"));
} catch(Exception e) {
System.out.println("In Exception block.");
errorMessage = e.getMessage();
} finally {
System.out.println(errorMessage);
}