Skip to content

Commit

Permalink
word_clock.py: handle failure to get time from ntptime
Browse files Browse the repository at this point in the history
  • Loading branch information
thirdr committed Feb 26, 2025
1 parent 617b5fd commit bf87373
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/word_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def show_message(text):
show_message(e)

# Set the correct time using the NTP service.
ntptime.settime()
try:
ntptime.settime()
except OSError:
while True:
show_message("Unable to get time.\n\nCheck your network try again.")


def approx_time(hours, minutes):
Expand Down

0 comments on commit bf87373

Please sign in to comment.