wrap db call in try except
This commit is contained in:
@@ -84,12 +84,16 @@ async def api_tpos_create_invoice(
|
|||||||
|
|
||||||
@tpos_ext.get("/api/v1/tposs/{tpos_id}/invoices")
|
@tpos_ext.get("/api/v1/tposs/{tpos_id}/invoices")
|
||||||
async def api_tpos_get_latest_invoices(tpos_id: str = None):
|
async def api_tpos_get_latest_invoices(tpos_id: str = None):
|
||||||
payments = [
|
try:
|
||||||
Payment.from_row(row)
|
payments = [
|
||||||
for row in await get_latest_payments_by_extension(
|
Payment.from_row(row)
|
||||||
ext_name="tpos", ext_id=tpos_id
|
for row in await get_latest_payments_by_extension(
|
||||||
)
|
ext_name="tpos", ext_id=tpos_id
|
||||||
]
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e))
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user