1
0
Fork 0

Do not crash on missing token

This commit is contained in:
Lucidiot 2022-07-20 10:30:47 +02:00
parent 39a94276d5
commit bac5dde8b5
No known key found for this signature in database
GPG Key ID: FF629EE969FFE294
1 changed files with 2 additions and 7 deletions

View File

@ -99,13 +99,8 @@ def _fetch_api_token(session):
# api_token: "xoxs-12345-abcdefg....", # api_token: "xoxs-12345-abcdefg....",
# "api_token":"xoxs-12345-abcdefg....", # "api_token":"xoxs-12345-abcdefg....",
match_group = API_TOKEN_PATTERN.match(line.strip()) match_group = API_TOKEN_PATTERN.match(line.strip())
if not match_group: if match_group:
raise ParseError( return match_group.group(1)
"Could not parse API token from remote data! "
"Regex requires updating."
)
return match_group.group(1)
print("No api_token found in page. Search your https://<teamname>.slack.com/customize/emoji " print("No api_token found in page. Search your https://<teamname>.slack.com/customize/emoji "
"page source for \"api_token\" and enter its value manually.") "page source for \"api_token\" and enter its value manually.")