Skip to content

Commit

Permalink
Show error messages with a form to edit the SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 7, 2023
1 parent 2dd4e14 commit c138df6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datasette/views/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c138df6

Please sign in to comment.