regluit/booxtream/exceptions.py

13 lines
353 B
Python
Raw Normal View History

2013-08-23 21:14:48 +00:00
class BooXtreamError(Exception):
""" list of errors returned in xml
"""
def __init__(self, errors):
self.errors = errors
def __str__(self):
errormsg='BooXtream errors:'
for error in self.errors:
errormsg += 'Error %s: %s\n'% (error.find('Code').text,error.find('Msg').text)
return errormsg