-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve visibility for access_key token exception in get_token() #198
Conversation
Add try/except block for slicing access_token from response Add debug logger stdout on exception
Added debug log message
token = response.json()["access_token"] | ||
except(KeyError) : | ||
logger.error("ERROR: get_token() response is missing access_token key") | ||
raise KeyError("get_token() response is missing access_token key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something that adds language about where to look when this happens would be helpful.
raise KeyError("get_token() response is missing access_token key which indicates an error communicating with MS Teams. Check the app_id and app_secret.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to:
"get_token() response is missing access_token key, which indicates an error communicating with MS Teams. Check the app_id and app_secret."
More verbosity for error
@MeganerdDev I think this makes sense, but we do need to get the tests passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this debugging, this will be very helpful in troubleshooting MS Teams issues.
Closes: #197
What's Changed
Adds a try/except block for slicing access_token from response
Adds error logger message to stdout on exception slicing get_token() response.json()["access_key"]
Adds debug logger message to stdout on get_token() that prints json response data
TODO