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,10 +160,15 @@ def enroll(identity, subtype):
while True: while True:
glow_start_scan() glow_start_scan()
try:
err = capture(enroll_prg) err = capture(enroll_prg)
if err != 0: if err != 0:
print('Error %08x, try again' % err) print('Error %08x, try again' % err)
continue continue
except Exception as e:
print('Capture failed (%s), try again' % repr(e))
sleep(1)
continue
key = enrollment_update_start(key) key = enrollment_update_start(key)
header, template, tid = append_new_image(key, template) header, template, tid = append_new_image(key, template)