From c138df61e120096e7da1f546cfcb5ff676f13fd0 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 7 Aug 2023 11:20:43 -0700 Subject: [PATCH] Show error messages with a form to edit the SQL --- datasette/views/database.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datasette/views/database.py b/datasette/views/database.py index 4c6818fa50..77f729d26d 100644 --- a/datasette/views/database.py +++ b/datasette/views/database.py @@ -354,6 +354,11 @@ async def query_view( status=400, message_is_html=True, ) + except sqlite3.DatabaseError as ex: + query_error = ex + results = None + rows = [] + columns = [] except (sqlite3.OperationalError, InvalidSql) as ex: raise DatasetteError(str(ex), title="Invalid SQL", status=400) except sqlite3.OperationalError as ex: