Verified Commit c4dabbb8 authored by Rahix's avatar Rahix
Browse files

fix(simple_menu): Fix Menu.exit() not working

Fixes #155

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 0bb730d5
Pipeline #3931 passed with stages
in 54 seconds
......@@ -282,6 +282,8 @@ class Menu:
self.idx = (self.idx + 1) % len(self.entries)
try:
self.on_scroll(self.entries[self.idx], self.idx)
except _ExitMenuException:
raise
except Exception as e:
print("Exception during menu.on_scroll():")
sys.print_exception(e)
......@@ -291,6 +293,8 @@ class Menu:
self.idx = (self.idx + len(self.entries) - 1) % len(self.entries)
try:
self.on_scroll(self.entries[self.idx], self.idx)
except _ExitMenuException:
raise
except Exception as e:
print("Exception during menu.on_scroll():")
sys.print_exception(e)
......@@ -298,6 +302,8 @@ class Menu:
try:
self.on_select(self.entries[self.idx], self.idx)
self.select_time = utime.time_ms()
except _ExitMenuException:
raise
except Exception as e:
print("Menu crashed!")
sys.print_exception(e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment