Fix Error handling with ntp.settime()
This commit is contained in:
parent
7a1371fd18
commit
4b98e63c22
11
code/main.py
11
code/main.py
@ -91,12 +91,15 @@ def set_rtc():
|
||||
while True:
|
||||
try:
|
||||
return ntptime.settime()
|
||||
except OSError as e:
|
||||
if e.errno == 110:
|
||||
except OSError as err:
|
||||
print("OS error: {0}".format(err))
|
||||
if err.args[0] == 110:
|
||||
time.sleep(2)
|
||||
except OverflowError as e:
|
||||
print(e)
|
||||
except OverflowError as err:
|
||||
print("OverflowError: {0}".format(err))
|
||||
time.sleep(2)
|
||||
except Exception as err:
|
||||
return print(err)
|
||||
|
||||
|
||||
def now(clock):
|
||||
|
Loading…
Reference in New Issue
Block a user