From 19cf006d4f18c6c86cd4bbc3e02253c5638c88f5 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Mon, 24 Jul 2017 02:51:32 -0700 Subject: [PATCH] Make network error messages more specific --- components/net_traits/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index 8cece70866a4..7e841fd645bf 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -228,10 +228,8 @@ impl FetchTaskTarget for IpcSender { } fn process_response_eof(&mut self, response: &Response) { - if response.is_network_error() { - // todo: finer grained errors - let _ = - self.send(FetchResponseMsg::ProcessResponseEOF(Err(NetworkError::Internal("Network error".into())))); + if let Some(e) = response.get_network_error() { + let _ = self.send(FetchResponseMsg::ProcessResponseEOF(Err(e.clone()))); } else { let _ = self.send(FetchResponseMsg::ProcessResponseEOF(Ok(()))); }