better error reporting in wikipedia plugin
This commit is contained in:
parent
b1d722fdf7
commit
b965ec92ab
|
@ -25,6 +25,9 @@ def wiki(query):
|
||||||
items = x.findall(ns + 'Section/' + ns + 'Item')
|
items = x.findall(ns + 'Section/' + ns + 'Item')
|
||||||
|
|
||||||
if items == []:
|
if items == []:
|
||||||
|
if x.find('error') is not None:
|
||||||
|
return 'error: %(code)s: %(info)s' % x.find('error').attrib
|
||||||
|
else:
|
||||||
return 'no results found'
|
return 'no results found'
|
||||||
|
|
||||||
def extract(item):
|
def extract(item):
|
||||||
|
|
Loading…
Reference in New Issue