Check response code when fetching remote node file
Updates the circuit propose CLI's `--node-file` option handling to check
the HTTP response code for errors. If the response has an error code, an
error will be propagated up and logged.
@@ -201,6 +201,7 @@ fn load_nodes_from_file(node_file: &str) -> Result<Vec<Node>, CliError> {
fn load_nodes_from_remote(url: &str) -> Result<Vec<Node>, CliError> {
let bytes = reqwest::blocking::get(url)
+ .and_then(|response| response.error_for_status())
.map_err(|err| {
CliError::ActionError(format!(
"Failed to fetch remote node file from {}: {}",
