From e62e2cc440ccfa6a5d3b95c2809540c2a99c13a1 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Fri, 21 Oct 2016 16:11:52 -0700 Subject: [PATCH] catch exception if github is down --- lbrynet/lbrynet_daemon/UIManager.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lbrynet/lbrynet_daemon/UIManager.py b/lbrynet/lbrynet_daemon/UIManager.py index 09ab4755f..1a8183a40 100644 --- a/lbrynet/lbrynet_daemon/UIManager.py +++ b/lbrynet/lbrynet_daemon/UIManager.py @@ -74,7 +74,8 @@ class UIManager(object): self.loaded_branch = None self.loaded_requirements = None - def setup(self, branch=DEFAULT_UI_BRANCH, user_specified=None, branch_specified=False, check_requirements=None): + def setup(self, branch=DEFAULT_UI_BRANCH, user_specified=None, + branch_specified=False, check_requirements=None): if check_requirements is not None: self.check_requirements = check_requirements if self.branch is not None: @@ -104,9 +105,12 @@ class UIManager(object): def _up_to_date(self): def _get_git_info(): - response = urlopen(self._git_url) - data = json.loads(response.read()) - return defer.succeed(data['sha']) + try: + response = urlopen(self._git_url) + data = json.loads(response.read()) + return defer.succeed(data['sha']) + except Exception: + return defer.fail() def _set_git(version): self.git_version = version.replace('\n', '')