File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
CircuitPython_Zorque_Text_Game_openai Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: 2023 Jeff Epler for Adafruit Industries
22# SPDX-License-Identifier: MIT
33import os
4+ import traceback
45
56import adafruit_esp32spi .adafruit_esp32spi_socket as socket
67import adafruit_requests as requests
78import adafruit_touchscreen
89import board
910import displayio
11+ import supervisor
1012import terminalio
1113from adafruit_esp32spi import adafruit_esp32spi
1214from digitalio import DigitalInOut
@@ -254,5 +256,9 @@ def run_game_step(forced_choice=None):
254256 run_game_step ("New game" )
255257 while True :
256258 run_game_step ()
257- except (EOFError , KeyboardInterrupt ) as e :
258- raise SystemExit from e
259+ except Exception as e : # pylint: disable=broad-except
260+ traceback .print_exception (e )
261+ terminal .write (f"{ clear } An error occurred (more details on REPL).\r \n Touch the screen to re-load" )
262+ board .DISPLAY .refresh ()
263+ get_touchscreen_choice ()
264+ supervisor .reload ()
You can’t perform that action at this time.
0 commit comments