From be2b983ec199f63f3f6011e1a94b19d517ccda4f Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 21 Apr 2014 12:24:03 -0400 Subject: Make the I Tried star appear when a top-level page load fails for network-related reasons. Under the hood, this requires treating the I Tried pipeline as a new load instead of a replacement, since the failure-handling code interacts poorly with the rest of the replacement code when we get a series of staggered failures over time from the various pipeline components. --- src/components/util/task.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/components/util/task.rs') diff --git a/src/components/util/task.rs b/src/components/util/task.rs index 8500649370d..ec12b1eaf58 100644 --- a/src/components/util/task.rs +++ b/src/components/util/task.rs @@ -16,10 +16,15 @@ pub fn spawn_named>(name: S, f: proc()) { /// this `TaskBuilder` fails. pub fn send_on_failure(builder: &mut TaskBuilder, msg: T, dest: Sender) { let port = builder.future_result(); - spawn(proc() { + let watched_name = builder.opts.name.as_ref().unwrap().as_slice().to_owned(); + let name = format!("{:s}Watcher", watched_name); + spawn_named(name, proc() { match port.recv() { Ok(()) => (), - Err(..) => dest.send(msg), + Err(..) => { + debug!("{:s} failed, notifying constellation", watched_name); + dest.send(msg); + } } }) } -- cgit v1.2.3