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

Cryptic error message if GitHub token is incorrect #23

Open
starsep opened this issue May 27, 2020 · 1 comment
Open

Cryptic error message if GitHub token is incorrect #23

starsep opened this issue May 27, 2020 · 1 comment
Labels
enhancement New feature or request pr welcome Open for external contribution

Comments

@starsep
Copy link

starsep commented May 27, 2020

If you have leading/trailing space in token in config.toml (error in copy-pasting) i.e.

[github]
token = " TOKEN_HERE"

gitout

  • will be able to get repositories information including private ones
  • will crash when trying to clone first private repository it tries with cryptic error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: -1, klass: 34, message: "too many redirects or authentication replays" }', src/libcore/result.rs:1188:5

If token is incorrect in the other way then gitout crashes when trying to get repos info with

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /usr/src/rustc-1.41.0/src/libcore/macros/mod.rs:15:40

More helpful error message would be appreciated.
My api token is 40 hex characters.
I am not sure whether one could assert token format as there are probably no long-term guarantees in GitHub API.
I would assume there should be some endpoint which allows for easy checking whether provided token is correct. I checked that https://stackoverflow.com/a/58572011 seems to ignore extra spaces, haven't tried GraphQL API.

@JakeWharton
Copy link
Owner

Yeah this isn't great. For now there's zero error handling while core functionality is built out. Once more behavior is in place I'll start introducing anyhow for semantic failure messages and disable Rust's backtraces.

@JakeWharton JakeWharton added enhancement New feature or request pr welcome Open for external contribution labels May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr welcome Open for external contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants