From 33c70ddd4244952094abe43d2c86d36a70cd610b Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Tue, 25 May 2021 15:02:07 -0500 Subject: [PATCH] fix: don't squash request errors --- crates/rover-client/src/blocking/client.rs | 5 +++-- crates/rover-client/src/query/subgraph/introspect.rs | 3 +-- src/error/mod.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/rover-client/src/blocking/client.rs b/crates/rover-client/src/blocking/client.rs index 69d3b4a64..9c600508e 100644 --- a/crates/rover-client/src/blocking/client.rs +++ b/crates/rover-client/src/blocking/client.rs @@ -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::(response) } diff --git a/crates/rover-client/src/query/subgraph/introspect.rs b/crates/rover-client/src/query/subgraph/introspect.rs index 98e034cea..4192cc33f 100644 --- a/crates/rover-client/src/query/subgraph/introspect.rs +++ b/crates/rover-client/src/query/subgraph/introspect.rs @@ -22,9 +22,9 @@ pub fn run( client: &Client, headers: &HashMap, ) -> Result { - // let graph = variables.graph_id.clone(); let variables = introspection_query::Variables {}; let response_data = client.post::(variables, headers); + match response_data { Ok(data) => build_response(data), Err(e) => { @@ -37,7 +37,6 @@ pub fn run( } } } - // build_response(response_data) } fn build_response( diff --git a/src/error/mod.rs b/src/error/mod.rs index 92670f479..1da93d72b 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -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,