-
Notifications
You must be signed in to change notification settings - Fork 2
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
better errors for gh
when not logged in
#19
Comments
Ah, rrrhh so many are not following proper exit codes, your option sound like a good one although the command isn't the fastest (at least when logged)
I would output the same error verbatim, probably prefix with some "Host Error" or something similar
I'm not familiar with this flow can you elaborate? |
yeah,
👍
instead of using |
related to #19 this PR adds a new `check-gh-logged-in` command to `gh`. this command checks `gh auth status`, which will return a non-zero exit code and an error message when not logged in. Then, `check-gh-logged-in` will return a nice `nushell` unspanned error. the error is ``` Error: × You are not logged into any GitHub hosts. Run gh auth login to │ authenticate. │ ``` otherwise, when already logged in, nothing is shown at all and the scripts work as expected > **Note** > the slow down is quite small and hard to see, i think it's ok to have such a better error handling 😌
right now, the error is not that great when running
gh ...
being logged out 🤔and it does not fail in the sense that the
LAST_EXIT_CODE
is not set to1
in that case 🤔an idea that looks to be working: add
gh auth status
at the startremaining things: what happens when the user is
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
check-gh-logged-in
before runninggh
#20--logged-out
option to query the API withhttp get
The text was updated successfully, but these errors were encountered: