regluit/booxtream/exceptions.py

14 lines
357 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):
2018-06-08 19:17:39 +00:00
errormsg = 'BooXtream errors:'
2013-08-23 21:14:48 +00:00
for error in self.errors:
2018-06-08 19:17:39 +00:00
errormsg += 'Error %s: %s\n'% (error.find('Code').text, error.find('Msg').text)
return errormsg