diff --git a/plugins/wikipedia.py b/plugins/wikipedia.py index 0ff476c..659b603 100644 --- a/plugins/wikipedia.py +++ b/plugins/wikipedia.py @@ -25,7 +25,10 @@ def wiki(query): items = x.findall(ns + 'Section/' + ns + 'Item') if items == []: - return 'no results found' + if x.find('error') is not None: + return 'error: %(code)s: %(info)s' % x.find('error').attrib + else: + return 'no results found' def extract(item): return [item.find(ns + x).text for x in