lpapicache: remove try-except around login that only logs the error and then re-raises

This commit is contained in:
Dan Streetman 2022-08-09 12:07:31 -04:00
parent 06a04f642f
commit 9c1561ff26

View File

@ -74,12 +74,8 @@ class _Launchpad(object):
def login(self, service=service, api_version=api_version):
'''Enforce a non-anonymous login.'''
if not self.logged_in:
try:
self.__lp = LP.login_with('ubuntu-dev-tools', service,
version=api_version)
except IOError as error:
Logger.error(str(error))
raise
self.__lp = LP.login_with('ubuntu-dev-tools', service,
version=api_version)
else:
raise AlreadyLoggedInError('Already logged in to Launchpad.')