You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the current refresh token is expired and the user invokes wrangler whoami, the command results in an error:
(I only have a c3 version of the error, but the same error appears also when wrangler is invoked directly with an expired token)
It is unsurprising that invoking the command results in an error if the current session is invalid. What is surprising is that we are displaying this error as if it was an internal error or an unexpected crash. Notice the following part:
If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose
This seems to indicate to the user that this error is in some way unexpected, but that's not the case at all.
We know up front that calling whoami can result in three possible outcomes:
success: the user is logged in, we list user info
fail: the user is not logged in, we should simply notify the user and suggest that they use wrangler login to log in
crash: some internal error, in which case we should print any kind of contextual info about the error and suggest that the user files a bug
Note that we have two types of failure modes, one that is expected, and one that is unexpected.
Could we change the output of whoami (and elsewhere if there are other places like this) to make the expected failure mode look distinct (and more helpful, e.g. by suggesting wrangler login) from crashes due to an internal error?
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered:
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.6.0
What version of Node are you using?
18
What operating system are you using?
Mac
Describe the Bug
When the current refresh token is expired and the user invokes
wrangler whoami
, the command results in an error:(I only have a c3 version of the error, but the same error appears also when wrangler is invoked directly with an expired token)
It is unsurprising that invoking the command results in an error if the current session is invalid. What is surprising is that we are displaying this error as if it was an internal error or an unexpected crash. Notice the following part:
This seems to indicate to the user that this error is in some way unexpected, but that's not the case at all.
We know up front that calling
whoami
can result in three possible outcomes:wrangler login
to log inNote that we have two types of failure modes, one that is expected, and one that is unexpected.
Could we change the output of
whoami
(and elsewhere if there are other places like this) to make the expected failure mode look distinct (and more helpful, e.g. by suggestingwrangler login
) from crashes due to an internal error?Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: