From 433b60465a8acafd931aa3058c7d3f198b50dfe7 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Thu, 8 Jul 2010 21:47:32 +0200 Subject: [PATCH] Google plugin: report D-Bus errors --- src/plugins/google-plugin.vala | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/plugins/google-plugin.vala b/src/plugins/google-plugin.vala index abc0ef3..600c407 100644 --- a/src/plugins/google-plugin.vala +++ b/src/plugins/google-plugin.vala @@ -210,21 +210,27 @@ class GoogleSource : MovieSource { SourceFunc get_movies_callback; public override async int get_movies (MovieFilter filter, MovieSource.ReceiveMovieFunction _callback, int limit, Cancellable? cancellable) { - var conn = DBus.Bus.get (DBus.BusType.SESSION); - string search_path; - - dynamic DBus.Object server = conn.get_object ("org.maemo.cinaest.GoogleShowtimes", - "/org/maemo/cinaest/googleshowtimes", - "org.maemo.cinaest.MovieService"); - server.NewSearch (out search_path); - - search = conn.get_object ("org.maemo.cinaest.GoogleShowtimes", - search_path, - "org.maemo.cinaest.MovieSearch"); - - callback = _callback; - search.MoviesFound += on_movies_found; - search.start (filter.title); + try { + string search_path; + dynamic DBus.Object server; + var conn = DBus.Bus.get (DBus.BusType.SESSION); + + server = conn.get_object ("org.maemo.cinaest.GoogleShowtimes", + "/org/maemo/cinaest/googleshowtimes", + "org.maemo.cinaest.MovieService"); + server.NewSearch (out search_path); + + search = conn.get_object ("org.maemo.cinaest.GoogleShowtimes", + search_path, + "org.maemo.cinaest.MovieSearch"); + + callback = _callback; + search.MoviesFound.connect (on_movies_found); + search.start (filter.title); + } catch (Error e1) { + Banner.show_information (null, null, e1.message); + return 0; + } get_movies_callback = get_movies.callback; if (cancellable != null) -- 1.7.9.5