Skip to content

Correct browser credential timeout error message#14773

Merged
chlowell merged 1 commit intoAzure:masterfrom
chlowell:timeout
Oct 26, 2020
Merged

Correct browser credential timeout error message#14773
chlowell merged 1 commit intoAzure:masterfrom
chlowell:timeout

Conversation

@chlowell
Copy link
Copy Markdown
Member

On Python 2.7, when InteractiveBrowserCredential.get_token times out waiting for a user to authenticate it raises ClientAuthenticationError('Authentication failed: [Errno 9] Bad file descriptor'). That's the right error but the wrong message. The right message, as seen on Python 3.x, is "Timed out after waiting {...} seconds for the user to authenticate". The difference is due to the behavior of HTTPServer.handle_request(). On 2.7 it raises IOError but we were only expecting the ValueError raised on 3.x.

This PR fixes the behavior on 2.7 by handling IOError as well, and updates the test covering this behavior to use an actual instance of the redirect handler rather than a mock.

@chlowell chlowell added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Oct 26, 2020
@chlowell chlowell merged commit 4f8a21d into Azure:master Oct 26, 2020
@chlowell chlowell deleted the timeout branch October 26, 2020 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Identity Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants