Improve the error when failing to prompt for authentication credentials.
Review Request #12245 — Created April 20, 2022 and submitted
When attempting to request an authenticated user session,
get_authenticated_session()
may need to prompt for credentials. It
checks ifstdin
is a TTY before doing this, and if not, it attempts to
provide an error.In practice, this originally led to a crash in
APIError
string
building, which has been fixed in /r/12244/. This change further refines
this reworking the error message to be a bit more friendly and helpful,
less technical, and to place that error in the exception rather than the
log output.Unfortunately, this error (and authentication prompt logic) exists in
two places:get_authenticated_session()
and
Command.credentials_prompt()
. Both have been updated, but this change
isn't going to tackle consolidating these code paths.
Triggered this code path and saw a more helpful error message, without a
crash.Tested the Win32 and non-Win32 versions of this message.
Summary | ID |
---|---|
c7f78ff8146ea6c3c633e29a31fe512aa8ddd2ed |
- Change Summary:
-
Updated a second location for this error message.
- Description:
-
When attempting to request an authenticated user session,
get_authenticated_session()
may need to prompt for credentials. Itchecks if stdin
is a TTY before doing this, and if not, it attempts toprovide an error. In practice, this originally led to a crash in
APIError
stringbuilding, which has been fixed in /r/12244/. This change further refines this reworking the error message to be a bit more friendly and helpful, less technical, and to place that error in the exception rather than the log output. + + Unfortunately, this error (and authentication prompt logic) exists in
+ two places: get_authenticated_session()
and+ Command.credentials_prompt()
. Both have been updated, but this change+ isn't going to tackle consolidating these code paths. - Commits:
-
Summary ID af1763832afbb7fd8a95b490bce6f281c575b2e0 c7f78ff8146ea6c3c633e29a31fe512aa8ddd2ed - Diff:
-
Revision 2 (+94 -24)