add: basic upload error reporting

main
w2 2 years ago
parent 15bf8342a8
commit 1f099689a3

@ -201,7 +201,15 @@ def create_items(
for row in sheet["data"] for row in sheet["data"]
] ]
# dump all the data into database # dump all the data into database
accepted, processed = crud.insert_items(db=db, items=spreadsheet_item_list) try:
accepted, processed = crud.insert_items(db=db, items=spreadsheet_item_list)
except Exception as e:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
detail="{}".format(
e
),
)
# transform spreadsheet coordinates data into spacial # transform spreadsheet coordinates data into spacial
crud.add_spacial_data(db=db) crud.add_spacial_data(db=db)

Loading…
Cancel
Save