We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
client.user_info()
1 parent 9c834e0 commit 5fbca04Copy full SHA for 5fbca04
fairgraph/client.py
@@ -508,10 +508,15 @@ def user_info(self) -> Dict[str, Any]:
508
This information is that associated with the authorization token used.
509
"""
510
if self._user_info is None:
511
- try:
512
- self._user_info = self._kg_client.users.my_info().data
513
- except KeyError:
514
- self._user_info is None
+ response = self._kg_client.users.my_info()
+ if response.data:
+ self._user_info = response.data
+ elif response.error.code == 401:
515
+ raise AuthenticationError()
516
+ elif response.error.code == 403:
517
+ raise AuthorizationError()
518
+ else:
519
+ raise Exception(response.error)
520
return self._user_info
521
522
def spaces(
0 commit comments