create UserError exception
Modules can raise this exception when they want to print errors to user
This commit is contained in:
parent
b4154b5843
commit
aea269e9f6
21 changed files with 68 additions and 47 deletions
|
|
@ -20,22 +20,22 @@
|
|||
|
||||
from datetime import date, datetime
|
||||
|
||||
from .base import CapBaseObject, Field, StringField, DateField, DecimalField, IntField
|
||||
from .base import CapBaseObject, Field, StringField, DateField, DecimalField, IntField, UserError
|
||||
from .collection import ICapCollection
|
||||
|
||||
|
||||
__all__ = ['AccountNotFound', 'TransferError', 'Recipient', 'Account', 'Transaction', 'Transfer', 'ICapBank']
|
||||
|
||||
|
||||
class AccountNotFound(Exception):
|
||||
class AccountNotFound(UserError):
|
||||
"""
|
||||
Raised when an account is not found.
|
||||
"""
|
||||
|
||||
def __init__(self, msg='Account not found'):
|
||||
Exception.__init__(self, msg)
|
||||
UserError.__init__(self, msg)
|
||||
|
||||
class TransferError(Exception):
|
||||
class TransferError(UserError):
|
||||
"""
|
||||
A transfer has failed.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue