models.py: handle errors while reading metadata