Skip to content

Commit a748fb0

Browse files
committed
Added exception catching to network related function calls to account for occasional timeout from the esp chip
1 parent 989d77c commit a748fb0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_pyportal.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,13 @@ def io_push(self, feed, data):
678678
except AdafruitIO_RequestError:
679679
# If no feed exists, create one
680680
feed_id = io_connect.create_new_feed(feed)
681+
except RuntimeError as exception:
682+
print("Some error occured, retrying! -", exception)
681683

682-
io_connect.send_data(feed_id['key'], data)
684+
try:
685+
io_connect.send_data(feed_id['key'], data)
686+
except RuntimeError as exception:
687+
print("Some error occured, retrying! -", exception)
683688

684689
def fetch(self, refresh_url=None):
685690
"""Fetch data from the url we initialized with, perfom any parsing,

0 commit comments

Comments
 (0)