mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor resource loaders to use send_error utility.
No substantial functional change.
This commit is contained in:
parent
bc58cd2de0
commit
10664cf3f4
5 changed files with 20 additions and 26 deletions
|
@ -50,6 +50,15 @@ impl ProgressSender {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn send_error(url: Url, err: String, start_chan: LoadConsumer) {
|
||||
let mut metadata: Metadata = Metadata::default(url);
|
||||
metadata.status = None;
|
||||
|
||||
if let Ok(p) = start_sending_opt(start_chan, metadata) {
|
||||
p.send(Done(Err(err))).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
/// For use by loaders in responding to a Load message.
|
||||
pub fn start_sending(start_chan: LoadConsumer, metadata: Metadata) -> ProgressSender {
|
||||
start_sending_opt(start_chan, metadata).ok().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue