Commit 76222c78 authored by Michael Gratton's avatar Michael Gratton 🤞

Both check for and throw Cancelled errors some more

Fixes some crashes when switching folders by keeping the down arrow
held down.
parent 218c5ebf
Pipeline #76758 passed with stages
in 35 minutes and 51 seconds
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment