Revision: 4109 Author: btongminh Date: 2007-08-25 22:03:50 +0000 (Sat, 25 Aug 2007)
Log Message: ----------- Raise an exception if an error has occured.
Modified Paths: -------------- trunk/pywikipedia/checkusage.py
Modified: trunk/pywikipedia/checkusage.py =================================================================== --- trunk/pywikipedia/checkusage.py 2007-08-25 16:14:36 UTC (rev 4108) +++ trunk/pywikipedia/checkusage.py 2007-08-25 22:03:50 UTC (rev 4109) @@ -143,6 +143,11 @@ data = simplejson.load(res) finally: res.close() + + if 'error' in data: + raise wikipedia.Error(data['error']['code'], + data['error']['info']) + return data def close(self): self._conn.close()