Catch unknown sync exceptions when opening device and show error.

Some devices lack writable info and gpodder assumes they are writable.
This can lead to an exception being thrown when not writable.
This commit is contained in:
auouymous 2022-09-19 22:51:53 -06:00
parent 04a0116a31
commit 37ad7cac89
1 changed files with 12 additions and 4 deletions

View File

@ -105,14 +105,22 @@ class gPodderSyncUI(object):
done_callback()
return
if not device.open():
try:
if not device.open():
self._show_message_cannot_open()
if done_callback:
done_callback()
return
else:
# Only set if device is configured and opened successfully
self.device = device
except Exception as err:
logger.error('opening destination %s failed with %s',
device.destination.get_uri(), err.message)
self._show_message_cannot_open()
if done_callback:
done_callback()
return
else:
# Only set if device is configured and opened successfully
self.device = device
if episodes is None:
force_played = False