From 373ca5cedf6754bf05ebd743ffba560784d9f5bd Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Mon, 19 Mar 2007 11:49:01 +0000 Subject: display an error message when no plugin are available to handle a service type git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@135 3be567f1-68ff-0310-b24a-ad7cc433fd2f --- src/service-discovery-applet.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/service-discovery-applet.in b/src/service-discovery-applet.in index 08fb577..19cecc6 100755 --- a/src/service-discovery-applet.in +++ b/src/service-discovery-applet.in @@ -271,7 +271,10 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): txts = avahi.txt_array_to_string_array(txt) txts = sdapplet.pluginutils.pair_to_dict(txts) - self.plugin.plugins[type][0].connect(self.use_host_names, name, type, host, address, port, txts) + try: + self.plugin.plugins[type][0].connect(self.use_host_names, name, type, host, address, port, txts) + except KeyError,e: + error_msg("No plugin to handle %s" % type) def print_error(self, err): # FIXME we should use notifications -- cgit