Skip to content

Commit 3a926ce

Browse files
f
1 parent 89cfcb7 commit 3a926ce

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

git_logger.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77

88
def login(token):
9-
if 1:
9+
try:
1010
client = RepositoryFactory.create_api("github", token)
11-
# except Exception as err:
12-
# print(f'Github: Connect: error {err}')
13-
# print('Github: Connect: user could not be authenticated please try again.')
14-
# exit(1)
15-
# else:
11+
except Exception as err:
12+
print(f'Github: Connect: error {err}')
13+
print('Github: Connect: user could not be authenticated please try again.')
14+
exit(1)
15+
else:
1616
return client
1717

1818

@@ -50,16 +50,16 @@ def get_next_repo(clients: IClients, repositories):
5050
list_repos = [x for x in file.read().split('\n') if x]
5151
print(list_repos)
5252
for repo_name in list_repos:
53-
if 1:
53+
try:
5454
cur_client = clients.get_next_client()
5555
repo = cur_client['client'].get_repository(repo_name)
5656
if not repo:
5757
raise Exception(f"Repository {repo_name} not found.")
58-
# except Exception as err:
59-
# print(f'Github: Connect: error {err}')
60-
# print(f'Github: Connect: failed to load repository "{repo_name}"')
61-
# exit(1)
62-
# else:
58+
except Exception as err:
59+
print(f'Github: Connect: error {err}')
60+
print(f'Github: Connect: failed to load repository "{repo_name}"')
61+
exit(1)
62+
else:
6363
yield repo
6464

6565

0 commit comments

Comments
 (0)