Skip to content

Commit

Permalink
Improve debug logging for errors in workers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed May 8, 2023
1 parent f72eed9 commit 65c8bbc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions spyder/workers/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ def start(self):
self.update_from_github = False
self.get_releases()
self.check_update_available()
except HTTPError:
except HTTPError as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to retrieve information.')
except URLError:
except URLError as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to connect to the internet. <br><br>Make '
'sure the connection is working properly.')
except Exception:
except Exception as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to check for updates.')

if self.error:
logger.info(self.error)

try:
self.sig_ready.emit()
except RuntimeError:
Expand Down Expand Up @@ -243,17 +243,17 @@ def start(self):
if self.installer_path:
os.remove(self.installer_path)
return
except HTTPError:
except HTTPError as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to retrieve installer information.')
except URLError:
except URLError as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to connect to the internet. <br><br>'
'Make sure the connection is working properly.')
except Exception:
except Exception as exc:
logger.debug(exc, stack_info=True)
self.error = _('Unable to download the installer.')

if self.error:
logger.info(self.error)

try:
self.sig_ready.emit()
except RuntimeError:
Expand Down

0 comments on commit 65c8bbc

Please sign in to comment.