create UserError exception

Modules can raise this exception when they want to print errors to user
This commit is contained in:
Romain Bignon 2012-04-25 13:43:52 +02:00
commit aea269e9f6
21 changed files with 68 additions and 47 deletions

View file

@ -27,7 +27,7 @@ from weboob.tools.misc import to_unicode
from weboob.tools.ordereddict import OrderedDict
__all__ = ['FieldNotFound', 'NotAvailable', 'NotLoaded', 'IBaseCap',
__all__ = ['UserError', 'FieldNotFound', 'NotAvailable', 'NotLoaded', 'IBaseCap',
'Field', 'IntField', 'DecimalField', 'FloatField', 'StringField',
'BytesField', 'DateField', 'DeltaField', 'empty', 'CapBaseObject']
@ -44,6 +44,12 @@ def empty(value):
return False
class UserError(Exception):
"""
Exception containing an error message for user.
"""
class FieldNotFound(Exception):
"""
A field isn't found.