[flatpak] fix: handling json decode error when retrieving screenshots

This commit is contained in:
Vinicius Moreira
2019-10-24 15:51:05 -03:00
parent 8d7cf689bd
commit e0041a3c73

View File

@@ -290,7 +290,10 @@ class FlatpakManager(SoftwareManager):
if s.get('imgDesktopUrl'):
urls.append(s['imgDesktopUrl'])
except json.decoder.JSONDecodeError:
self.context.logger.error("Could not decode json from '{}'".format(screenshots_url))
except Exception as e:
if e.__class__.__name__ == 'JSONDecodeError':
self.context.logger.error("Could not decode json from '{}'".format(screenshots_url))
else:
traceback.print_exc()
return urls