View Revisions: Issue #5889

Summary 0005889: Reject logic crashes for across-the-zero reimbursements.
Revision 2019-09-11 00:07 by Marcello Stanisci
Additional Information Some logs.

Sep 10 23:40:12-997764 test-bank-api-with-(fake)bank-new-8179 DEBUG Running command `reject-1'
Sep 10 23:40:12-997785 test-bank-api-with-(fake)bank-new-8179 INFO Account 2 rejects deposit
Internal Server Error: /reject
Traceback (most recent call last):
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.7/contextlib.py", line 74, in inner
    return func(*args, **kwds)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/views.py", line 561, in _decorator
    return view_func(request, user_account, *args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/views.py", line 807, in reject
    trans.credit_account.amount.subtract(trans.amount)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/amount.py", line 224, in subtract
    raise ValueError('self is lesser than amount to be subtracted')
ValueError: self is lesser than amount to be subtracted
2019-09-10 21:40:13,155 log ERROR Internal Server Error: /reject
Traceback (most recent call last):
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.7/contextlib.py", line 74, in inner
    return func(*args, **kwds)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/views.py", line 561, in _decorator
    return view_func(request, user_account, *args, **kwargs)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/views.py", line 807, in reject
    trans.credit_account.amount.subtract(trans.amount)
  File "/home/marcello/.local/lib/python3.7/site-packages/talerbank/app/amount.py", line 224, in subtract
    raise ValueError('self is lesser than amount to be subtracted')
ValueError: self is lesser than amount to be subtracted
10/Sep/2019:21:40:12 +0000 HTTP/1.1 POST /reject HTTP/1.1 => 500
Revision 2019-09-11 00:05 by Marcello Stanisci
Additional Information