Handle file_get_content errors by throwing an exception