diff --git a/python_payload/apps/updat3r/__init__.py b/python_payload/apps/updat3r/__init__.py index cb60e00499ddf6a940e96060d6f8e032847f92e7..1f3a31759831d59ab4fc8181309bc22cad6d35b8 100644 --- a/python_payload/apps/updat3r/__init__.py +++ b/python_payload/apps/updat3r/__init__.py @@ -129,6 +129,9 @@ class UpdaterApp(Application): yield path_fd.tell(), total_size if len(new_data) < block_size: break + except OSError as e: + if "EIO" in str(e): + self._sd_failed = True finally: path_fd.close() req.close() @@ -183,7 +186,11 @@ class UpdaterApp(Application): return if self._sd_failed: - self._state_text = "don't panic, but...\na weird SD bug happened D:\nturn off and on flow3r power (ha)\nthen try to reattempt\ndownloading the update\n\nyou got this." + self._state_text = ( + "don't panic, but...\na weird SD bug happened D:\nturn off and on flow3r power (ha)\n" + "and retry. some SD cards don't\nwork for this at all tho :/\n\n" + "if this error repeats try\nhttps://flow3r.garden/flasher\ninstead!" + ) return if not st3m.wifi.is_connected() and not st3m.wifi.is_connecting():