Skip to content

Commit a153e37

Browse files
author
brentru
committed
check status code, raise valuerror
1 parent 7cbb3e8 commit a153e37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_pyportal.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ def get_local_time(self, location=None):
620620
api_url += TIME_SERVICE_STRFTIME
621621
try:
622622
response = requests.get(api_url)
623+
if response.status_code != 200:
624+
raise ValueError(response.text)
623625
if self._debug:
624626
print("Time request: ", api_url)
625627
print("Time reply: ", response.text)

0 commit comments

Comments
 (0)