Merge branch 'wip/fast-folder-switching-crashes' into 'mainline'

Both check for and throw Cancelled errors some more

See merge request GNOME/geary!218
This commit is contained in:
Michael Gratton 2019-04-21 07:00:09 +00:00
commit d12edc298a
2 changed files with 13 additions and 4 deletions

View file

@ -98,10 +98,6 @@ public class Application.ContactStore : Geary.BaseObject {
private async Folks.Individual? search_match(string address,
GLib.Cancellable cancellable)
throws GLib.Error {
if (cancellable.is_cancelled()) {
throw new GLib.IOError.CANCELLED("Contact load was cancelled");
}
Folks.SearchView view = new Folks.SearchView(
this.individuals,
new Folks.SimpleQuery(
@ -126,6 +122,11 @@ public class Application.ContactStore : Geary.BaseObject {
} catch (GLib.Error err) {
warning("Error unpreparing Folks search: %s", err.message);
}
if (cancellable.is_cancelled()) {
throw new GLib.IOError.CANCELLED("Contact load was cancelled");
}
return match;
}

View file

@ -574,6 +574,9 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
debug("Contact load failed for \"%s\": %s",
from != null ? from.to_string() : "<unknown>", err.message);
}
if (this.load_cancellable.is_cancelled()) {
throw new GLib.IOError.CANCELLED("Contact load was cancelled");
}
}
/**
@ -622,6 +625,9 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
if (loaded) {
try {
yield update_body();
} catch (GLib.IOError.CANCELLED err) {
this.body_loading_timeout.reset();
throw err;
} catch (GLib.Error err) {
this.body_loading_timeout.reset();
handle_load_failure(err);
@ -792,6 +798,8 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
try {
this.email = loaded;
yield update_body();
} catch (GLib.IOError.CANCELLED err) {
// All good
} catch (GLib.Error err) {
debug("Remote message update failed: %s", err.message);
handle_load_failure(err);