mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Also improved API explorer to show HTTP status of response, refs #1871
This commit is contained in:
parent
9bec7c38eb
commit
497290beaf
3 changed files with 24 additions and 6 deletions
|
|
@ -1206,7 +1206,10 @@ class TableInsertView(BaseView):
|
|||
else:
|
||||
table.insert_all(rows, ignore=ignore, replace=replace)
|
||||
|
||||
rows = await db.execute_write_fn(insert_rows)
|
||||
try:
|
||||
rows = await db.execute_write_fn(insert_rows)
|
||||
except Exception as e:
|
||||
return _error([str(e)])
|
||||
result = {"ok": True}
|
||||
if should_return:
|
||||
result["rows"] = rows
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue