Skip to content
Snippets Groups Projects
Commit 520bcc2c authored by moon2's avatar moon2 :speech_balloon:
Browse files

updat3r: don't crash when sd breaks mid-transit

parent 19e7a106
Branches
Tags
1 merge request!691Updat3r sd error
Pipeline #12930 passed
......@@ -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():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment