Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cirro/auth/device_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,13 @@
if not self._persistence or not self._token_path.exists():
return None

token_info = json.loads(self._persistence.load())
try:
token_info = json.loads(self._persistence.load())
except (json.JSONDecodeError, ValueError):

Check warning on line 241 in cirro/auth/device_code.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this redundant Exception class; it derives from another which is already caught.

See more on https://sonarcloud.io/project/issues?id=CirroBio_Cirro-client&issues=AZ5xdP_MoIt0FrcHdNz-&open=AZ5xdP_MoIt0FrcHdNz-&pullRequest=206
logger.debug('Saved token file is empty or invalid, clearing it')
self._clear_token_info()
return None

if 'access_token' not in token_info:
return None

Expand Down
Loading