Skip to content

Commit

Permalink
Auto merge of #3146 - JohnTitor:no-longer-login, r=Turbo87
Browse files Browse the repository at this point in the history
Remove outdated information about GitHub permission error

https://crates.io/login is no longer valid (found in rust-lang/cargo#9000 (comment)) and it's just enough to recommend re-authentication now, I think.
  • Loading branch information
bors committed Dec 30, 2020
2 parents 677dd0f + ee3f009 commit 178019b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,23 @@ where
.header(header::USER_AGENT, "crates.io (https://crates.io)")
.send()?
.error_for_status()
.map_err(|e| handle_error_response(app, &e))?
.map_err(|e| handle_error_response(&e))?
.json()
.map_err(Into::into)
}

fn handle_error_response(app: &App, error: &reqwest::Error) -> Box<dyn AppError> {
fn handle_error_response(error: &reqwest::Error) -> Box<dyn AppError> {
use reqwest::StatusCode as Status;

match error.status() {
Some(Status::UNAUTHORIZED) | Some(Status::FORBIDDEN) => cargo_err(&format!(
Some(Status::UNAUTHORIZED) | Some(Status::FORBIDDEN) => cargo_err(
"It looks like you don't have permission \
to query a necessary property from Github \
to query a necessary property from GitHub \
to complete this request. \
You may need to re-authenticate on \
crates.io to grant permission to read \
github org memberships. Just go to \
https://{}/login",
app.config.domain_name,
)),
GitHub org memberships.",
),
Some(Status::NOT_FOUND) => not_found(),
_ => internal(&format_args!(
"didn't get a 200 result from github: {}",
Expand Down

0 comments on commit 178019b

Please sign in to comment.