Add API error handling for Bitbucket
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Support question? | no |
| Version | 1.4 |
Actual Behavior
Getting user information doesn't return the user information in case the API token expires or there is an another API error.
Expected Behavior
In case of an expired token, getting user information should be retired with the refresh token. Other API errors should be handled as well.
Steps to Reproduce
Attempt to use Bitbucket2ResourceOwner::getUserInformation with an expired API token.
Possible Solutions
I've seen this happen with Bitbucket where an expired token wasn't handled. In case the account didn't have an email set it failed to also grab the email from emails_url and it was throwing an undefined index. I created a draft PR with a solution for my specfic case with Bitbucket: https://github.com/hwi/HWIOAuthBundle/pull/1805/files I'm not sure if this needs to be addressed for other resources as well or if there is a way to handle this in a more generic way. Happy to help on the PR if you think this is useful and can be merged.