Skip to content

Commit ecf0694

Browse files
committed
fix retries in POST example
1 parent e27585a commit ecf0694

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/espatcontrol_post.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@
4242
header, body = esp.request_url(URL+str(counter), type = "POST")
4343
counter = counter + 1
4444
print("OK")
45-
except RuntimeError as e:
46-
print("Failed to connect, retrying")
47-
print(e)
45+
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
46+
print("Failed to get data, retrying\n", e)
4847
continue
4948
header = body = None
5049
time.sleep(15)

0 commit comments

Comments
 (0)