Merge lp:~stolowski/unity-lens-video/handle-cancellation-exception into lp:~unity-team/unity-lens-video/libunity7-compatible

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 123
Merged at revision: 123
Proposed branch: lp:~stolowski/unity-lens-video/handle-cancellation-exception
Merge into: lp:~unity-team/unity-lens-video/libunity7-compatible
Diff against target: 27 lines (+9/-2)
1 file modified
src/remote-scope.vala (+9/-2)
To merge this branch: bzr merge lp:~stolowski/unity-lens-video/handle-cancellation-exception
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+158404@code.launchpad.net

Commit message

Handle an exception when search is cancelled, so that search.finished() is always signalled.

Description of the change

Handle an exception when search is cancelled, so that search.finished() is always signalled.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/remote-scope.vala'
2--- src/remote-scope.vala 2013-04-11 14:38:11 +0000
3+++ src/remote-scope.vala 2013-04-11 15:37:35 +0000
4@@ -353,7 +353,14 @@
5 {
6 if (at_least_one_source_is_on (active_sources))
7 {
8- yield perform_search (search_string, search, active_sources, cancellable);
9+ try
10+ {
11+ yield perform_search (search_string, search, active_sources, cancellable);
12+ }
13+ catch (Error e)
14+ {
15+ warning ("Search interrupted: %s", e.message);
16+ }
17 }
18 }
19
20@@ -381,7 +388,7 @@
21
22 /* Query the server with the search string and the list of sources.
23 */
24- private async void perform_search (string search_string, DeprecatedScopeSearch search, Gee.ArrayList<string> active_sources, GLib.Cancellable? cancellable)
25+ private async void perform_search (string search_string, DeprecatedScopeSearch search, Gee.ArrayList<string> active_sources, GLib.Cancellable? cancellable) throws Error
26 {
27 search.results_model.clear ();
28

Subscribers

People subscribed via source and target branches