Update https.py

Add exeption on code 500