Skip to content

Commit

Permalink
servo: Merge #17835 - Make network error messages more specific (from…
Browse files Browse the repository at this point in the history
… KiChjang:clearer-network-error); r=emilio

Instead of having a bogus "Network error" string, we extract the NetworkError struct from the Response and send it back to FetchResponseListener.

Source-Repo: https://github.com/servo/servo
Source-Revision: a56bd4663b30e3a5722d095b412b4340cf695cac
  • Loading branch information
KiChjang committed Jul 24, 2017
1 parent 1178516 commit 49a92e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions servo/components/net_traits/lib.rs
Original file line number Diff line number Diff line change
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 49a92e4

Please sign in to comment.