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:
glow_start_scan()
err = capture(enroll_prg)
if err != 0:
print('Error %08x, try again' % err)
try:
err = capture(enroll_prg)
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
key = enrollment_update_start(key)