forked from LBRYCommunity/lbry-sdk
catch exception if github is down
This commit is contained in:
parent
727ea12dbd
commit
e62e2cc440
1 changed files with 8 additions and 4 deletions
|
@ -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', '')
|
||||
|
|
Loading…
Reference in a new issue