Skip to content

Commit

Permalink
Merge pull request #672 from akrymskiy/master
Browse files Browse the repository at this point in the history
Error handling for when response is not present
  • Loading branch information
vgrem committed Apr 17, 2023
2 parents 1c73ea9 + 491a7b3 commit 26049e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions office365/runtime/auth/providers/acs_token_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def get_app_only_access_token(self):
url_info = urlparse(self.url)
return self._get_app_only_access_token(url_info.hostname, realm)
except requests.exceptions.RequestException as e:
self.error = e.response.text
raise ValueError(e.response.text)
self.error = e.response.text if e.response else None
raise ValueError(self.error)

def _get_app_only_access_token(self, target_host, target_realm):
"""
Expand Down

0 comments on commit 26049e1

Please sign in to comment.