lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 156 forks source link

CI misses errors on event handlers #202

Closed amirgon closed 2 years ago

amirgon commented 2 years ago

When an error occurs on an event handler, the exception in caught and ignored by the scheduler: For example:

Traceback (most recent call last):
  File "lv_utils.py", line 117, in task_handler
  File "<string>", line 88, in event_cb
  File "<string>", line 124, in draw
AttributeError: 'module' object has no attribute 'draw_polygon'

To fix this, consider catching exceptions on the event loop task_handler and exit with sys.exit(1) if its available.

https://github.com/lvgl/lv_binding_micropython/blob/620a3de2408d2ccb283c2e710c77c6cf006b42e3/lib/lv_utils.py#L116-L119