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

Remove outdated information about GitHub permission error #3146

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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