As it stands, using unauthorized credentials results in a TypeError exception being raised in the token_header function:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flair_api/client.py", line 223, in get
headers=dict(self.token_header(), **DEFAULT_CLIENT_HEADERS)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flair_api/client.py", line 205, in token_header
headers = {'Authorization': 'Bearer ' + self.token}
TypeError: can only concatenate str (not "NoneType") to str
The proposed change would instead raise a proper exception within the oauth_token function with the following output:
As it stands, using unauthorized credentials results in a TypeError exception being raised in the token_header function:
The proposed change would instead raise a proper exception within the oauth_token function with the following output:
flair_api.client.ApiError: ApiError<HTTP Response: 401>