Files
@ d199b5dd42f0
Branch filter:
Location: NPO-Accounting/experimental-accounting-api/accounting/exceptions.py - annotation
d199b5dd42f0
651 B
text/x-python
Add basic install instructions for Debian wheezy.
fc2c3a6b4339 fc2c3a6b4339 fc2c3a6b4339 fc2c3a6b4339 6f2c875c7b76 6f2c875c7b76 6f2c875c7b76 6f2c875c7b76 6f2c875c7b76 8abbe3462fda 281d6fed47b7 281d6fed47b7 281d6fed47b7 281d6fed47b7 281d6fed47b7 281d6fed47b7 281d6fed47b7 8abbe3462fda fcec13c548be fcec13c548be fcec13c548be 8abbe3462fda fcec13c548be fcec13c548be fcec13c548be 8abbe3462fda | # Part of accounting-api project:
# https://gitorious.org/conservancy/accounting-api
# License: AGPLv3-or-later
class AccountingException(Exception):
'''
Used as a base for exceptions that are returned to the caller via the
jsonify_exceptions decorator
'''
http_code = 500
def __init__(self, message, **kw):
self.message = message
for key, value in kw.items():
setattr(self, key, value)
class TransactionNotFound(AccountingException):
http_code = 404
class LedgerNotBalanced(AccountingException):
http_code = 400
class TransactionIDCollision(AccountingException):
http_code = 400
|