Refactored error/exception handling for file_reader and added a test suite for it