Wrap code in exception handler to capture IOErrors when opening the files.