Skip to content

Commit 39c672d

Browse files
committed
More runtime error catches
1 parent 1756c81 commit 39c672d

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

examples/esp32spi_aio_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
response.close()
6767
counter = counter + 1
6868
print("OK")
69-
except (ValueError, RuntimeError) as e:
69+
except (ValueError, OSError) as e:
7070
print("Failed to get data, retrying\n", e)
7171
wifi.reset()
7272
continue

examples/esp32spi_cheerlights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
value = value[key]
5555
print(value)
5656
response.close()
57-
except (ValueError, RuntimeError) as e:
57+
except (ValueError, OSError) as e:
5858
print("Failed to get data, retrying\n", e)
5959
wifi.reset()
6060
continue

examples/esp32spi_ipconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
while not esp.is_connected:
5050
try:
5151
esp.connect_AP(secrets["ssid"], secrets["password"])
52-
except RuntimeError as e:
52+
except OSError as e:
5353
print("could not connect to AP, retrying: ", e)
5454
continue
5555
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)

examples/esp32spi_localtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
print("Fetching json from", TIME_API)
4343
response = wifi.get(TIME_API)
4444
break
45-
except (ValueError, RuntimeError) as e:
45+
except (ValueError, OSError) as e:
4646
print("Failed to get data, retrying\n", e)
4747
continue
4848

examples/esp32spi_wpa2ent_aio_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
response.close()
6464
counter = counter + 1
6565
print("OK")
66-
except (ValueError, RuntimeError) as e:
66+
except (ValueError, OSError) as e:
6767
print("Failed to get data, retrying\n", e)
6868
wifi.reset()
6969
continue

examples/server/esp32spi_wsgiserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def led_color(environ): # pylint: disable=unused-argument
213213
static
214214
)
215215
)
216-
except (OSError) as e:
216+
except OSError as e:
217217
raise RuntimeError(
218218
"""
219219
This example depends on a static asset directory.
@@ -240,7 +240,7 @@ def led_color(environ): # pylint: disable=unused-argument
240240
try:
241241
wsgiServer.update_poll()
242242
# Could do any other background tasks here, like reading sensors
243-
except (ValueError, RuntimeError) as e:
243+
except (ValueError, OSError) as e:
244244
print("Failed to update server, restarting ESP32\n", e)
245245
wifi.reset()
246246
continue

0 commit comments

Comments
 (0)