better error reporting in wikipedia plugin

This commit is contained in:
Ryan Hitchman 2009-03-30 17:32:52 -06:00
parent b1d722fdf7
commit b965ec92ab
1 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,9 @@ def wiki(query):
items = x.findall(ns + 'Section/' + ns + 'Item')
if items == []:
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):