Deindent some of the code in http_network_fetch.

This commit is contained in:
Ms2ger 2016-11-07 09:46:38 +01:00
parent f5a3d68513
commit 40c6b21fd7

View file

@ -1018,8 +1018,19 @@ fn http_network_fetch<UI: 'static + UIProvider>(request: Rc<Request>,
let pipeline_id = request.pipeline_id.get(); let pipeline_id = request.pipeline_id.get();
let mut response = Response::new(); let mut response = Response::new();
match wrapped_response { let (res, msg) = match wrapped_response {
Ok((res, msg)) => { Ok(wrapped_response) => wrapped_response,
Err(error) => {
let error = match error.error {
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
LoadErrorType::Cancelled => NetworkError::LoadCancelled,
e => NetworkError::Internal(e.description().to_owned())
};
return Response::network_error(error);
}
};
response.url = Some(url.clone()); response.url = Some(url.clone());
response.status = Some(res.response.status); response.status = Some(res.response.status);
response.raw_status = Some((res.response.status_raw().0, response.raw_status = Some((res.response.status_raw().0,
@ -1098,17 +1109,6 @@ fn http_network_fetch<UI: 'static + UIProvider>(request: Rc<Request>,
} }
} }
}); });
},
Err(error) => {
let error = match error.error {
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
LoadErrorType::Cancelled => NetworkError::LoadCancelled,
e => NetworkError::Internal(e.description().to_owned())
};
return Response::network_error(error);
}
};
// TODO these substeps aren't possible yet // TODO these substeps aren't possible yet
// Substep 1 // Substep 1