Handle capture exceptions without breaking the enrollment loop.

This commit is contained in:
Viktor Dragomiretskyy 2020-06-24 02:48:50 +12:00
parent e9472c2ad3
commit 582d3c8f94

View file

@ -160,9 +160,14 @@ def enroll(identity, subtype):
while True: while True:
glow_start_scan() glow_start_scan()
err = capture(enroll_prg) try:
if err != 0: err = capture(enroll_prg)
print('Error %08x, try again' % err) if err != 0:
print('Error %08x, try again' % err)
continue
except Exception as e:
print('Capture failed (%s), try again' % repr(e))
sleep(1)
continue continue
key = enrollment_update_start(key) key = enrollment_update_start(key)