Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make network error messages more specific
  • Loading branch information
KiChjang committed Jul 24, 2017
1 parent d8b3f9b commit 19cf006
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/net_traits/lib.rs
Expand Up @@ -228,10 +228,8 @@ impl FetchTaskTarget for IpcSender<FetchResponseMsg> {
}

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(())));
}
Expand Down

0 comments on commit 19cf006

Please sign in to comment.