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 1
1
# SPDX-FileCopyrightText: 2023 Jeff Epler for Adafruit Industries
2
2
# SPDX-License-Identifier: MIT
3
3
import os
4
+ import traceback
4
5
5
6
import adafruit_esp32spi .adafruit_esp32spi_socket as socket
6
7
import adafruit_requests as requests
7
8
import adafruit_touchscreen
8
9
import board
9
10
import displayio
11
+ import supervisor
10
12
import terminalio
11
13
from adafruit_esp32spi import adafruit_esp32spi
12
14
from digitalio import DigitalInOut
@@ -254,5 +256,9 @@ def run_game_step(forced_choice=None):
254
256
run_game_step ("New game" )
255
257
while True :
256
258
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