fcec13c548
- Switched to passing the command via argv instead of stdin to ledger. We might as well as we don't use ledger's long-running mode in an effective manner. - Added version control of the ledger file using pygit2.A - Added error handling in the case of an unbalanced ledger, and cruder error handling in the case of any stderr output from ledger. - [web] Separated transaction_get into transaction_get and transaction_get_all.
25 lines
598 B
Python
25 lines
598 B
Python
# 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
|
|
'''
|
|
def __init__(self, message, **kw):
|
|
self.message = message
|
|
for key, value in kw.items():
|
|
setattr(self, key, value)
|
|
|
|
|
|
class TransactionNotFound(AccountingException):
|
|
pass
|
|
|
|
|
|
class LedgerNotBalanced(AccountingException):
|
|
pass
|
|
|
|
|
|
class TransactionIDCollision(AccountingException):
|
|
pass
|