Open atsuyaw opened 3 weeks ago
raise
may be available for this
https://uxmilk.jp/39845
import utime
def timer():
if utime.ticks_diff(utime.ticks_ms(), start) > 2000:
raise ValueError
time = utime.ticks_diff(utime.ticks_ms(), start)
print(time)
utime.sleep(1)
start = utime.ticks_ms()
while True:
try:
timer()
except ValueError:
start =+ 1
print(start)
except RuntimeError:
print("Run time err")
raise
except Exception:
# print(f"Unexpected {err}, {type(err)}")
print("Unexpected")
raise
Once an exceptional error is returned, report it by API and reboot the device. This make be able to explicitly fire alert with reasons.