Log the occurrence of exceptions in readFromFile function rather than printing them to the user