Printing exception and added test case

Added test case for SummaryReport::generate and printed the exception if
we fail to write a file in the generate method