Updated repo.py to send email on error.