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

fix: don't squash request errors #574

Merged
merged 2 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions crates/rover-client/src/blocking/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ impl Client {
} else {
e.into()
}
})?
.error_for_status()?;
})?;
// we don't `.error_for_status` here because it is handled
// in `Client::handle_response`

Client::handle_response::<Q>(response)
}
Expand Down
3 changes: 1 addition & 2 deletions crates/rover-client/src/query/subgraph/introspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub fn run(
client: &Client,
headers: &HashMap<String, String>,
) -> Result<IntrospectionResponse, RoverClientError> {
// let graph = variables.graph_id.clone();
let variables = introspection_query::Variables {};
let response_data = client.post::<IntrospectionQuery>(variables, headers);

match response_data {
Ok(data) => build_response(data),
Err(e) => {
Expand All @@ -37,7 +37,6 @@ pub fn run(
}
}
}
// build_response(response_data)
}

fn build_response(
Expand Down
2 changes: 1 addition & 1 deletion src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub use self::metadata::Suggestion;

/// A specialized `Error` type for Rover that wraps `anyhow`
/// and provides some extra `Metadata` for end users depending
/// on the speicif error they encountered.
/// on the specific error they encountered.
#[derive(Debug)]
pub struct RoverError {
error: anyhow::Error,
Expand Down