Added traceback to save voucher to better understand why an error occurs.

This commit is contained in:
Amritanshu Agrawal 2023-03-06 10:21:27 +05:30
parent e46fe7f90e
commit f408e84af3
1 changed files with 2 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import traceback
import uuid
from datetime import datetime, timedelta
@ -61,6 +62,7 @@ def save(
if item.voucher_type != VoucherType.KOT:
print_bill(voucher_id, db)
except SQLAlchemyError as e:
traceback.print_exc()
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=str(e),