summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2007-03-19 11:49:01 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2007-03-19 11:49:01 +0000
commit373ca5cedf6754bf05ebd743ffba560784d9f5bd (patch)
treed4e3b489e1fafb616b661797b5db092a2ae30d0b
parentc06db8b74051db8a8249c0a52f5ef65bed6a061a (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-xsrc/service-discovery-applet.in5
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