An exception handling code is added to analyseFolder method.