Skip to content
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

Error message didn't clearly indicate when missing PAT #21

Closed
jules32 opened this issue Feb 11, 2025 · 9 comments · Fixed by #24
Closed

Error message didn't clearly indicate when missing PAT #21

jules32 opened this issue Feb 11, 2025 · 9 comments · Fixed by #24

Comments

@jules32
Copy link

jules32 commented Feb 11, 2025

Hello! Thanks for this package, it is really super to have and use.

It is now working for me after I inspected my account and created a PAT.
Previously, when I only had one expired PAT in my account, I got the following error message:

download_organization_repos(organizations = "jules32")
Error in `purrr::map_chr()`:
ℹ In index: 1.
Caused by error in `.f()`:
! Could not find organization or user 'jules32'.
Run `rlang::last_trace()` to see where the error occurred.

[that is the full error, not truncated].

I don't have a reproducible example, and like I said above, I was able to inspect and update my PAT, but I wanted to share for awareness. Thank you!

@jules32
Copy link
Author

jules32 commented Feb 11, 2025

cc: @ateucher

@ateucher
Copy link

ateucher commented Feb 12, 2025

Hope you don't mind me jumping in: I think the issues is not that it failed, but that the error message didn't indicate an authentication error, which it likely was. Perhaps the error messages from the failures captured with try() could be included in the message, if it's not a 404 error (which I'm sure it wasn't for @jules32)?

@jules32
Copy link
Author

jules32 commented Feb 12, 2025

thanks @ateucher , yes that is correct!

@maelle
Copy link
Contributor

maelle commented Feb 13, 2025

Thank you both!

I agree regarding improving the error message.

I also need to add a mention of usethis::git_sitrep() to the docs.

@maelle
Copy link
Contributor

maelle commented Feb 13, 2025

That code for guessing what type of thing an username is really really wonky.

@maelle
Copy link
Contributor

maelle commented Feb 13, 2025

Actually I've now simplified the code so errors will come from gh directly: this way the user will see 401 and 404. Could you please have a look at #24?

Thanks again for reporting the bug.

@ateucher
Copy link

Yup, that makes perfect sense to me @maelle! Thanks for the quick fix!

@jules32
Copy link
Author

jules32 commented Feb 14, 2025

+1, Thank you so much @maelle !

@maelle
Copy link
Contributor

maelle commented Feb 14, 2025

Awesome, thank you for reviewing and thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants