harperreed / life360-python

A simple python life360 client
MIT License
35 stars 18 forks source link

Trapping 502 and 504 Bad Gateway errors #3

Open ryanbuckner opened 1 year ago

ryanbuckner commented 1 year ago

Can you add some error handling so the following 502 and 504 Bad Gateway errors are trapped when the Life360 API has issues?

File "life360.py", line 37, in authenticate
File "life360.py", line 26, in make_request
File "models.py", line 917, in json
Jun 6, 2023 at 06:59:45
Life360 Error [Errno Expecting value] <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>

Jun 6, 2023 at 07:00:30
Life360 Error [Errno Expecting value] <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>