diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2007-03-19 11:49:01 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2007-03-19 11:49:01 +0000 |
commit | 373ca5cedf6754bf05ebd743ffba560784d9f5bd (patch) | |
tree | d4e3b489e1fafb616b661797b5db092a2ae30d0b | |
parent | c06db8b74051db8a8249c0a52f5ef65bed6a061a (diff) |
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
-rwxr-xr-x | src/service-discovery-applet.in | 5 |
1 files changed, 4 insertions, 1 deletions
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 |