mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Table counts now handles SQL Logic Error too
I tried running Datasette against 22 database files at once and ran into a weird error where the table counts broke with an SQL Logic Error exception. Easy fix: catch that exception too and treat it the same as a regular Interrupted error.
This commit is contained in:
parent
b7fe722f05
commit
2ad9d15cd6
1 changed files with 3 additions and 1 deletions
|
|
@ -172,7 +172,9 @@ class ConnectedDatabase:
|
|||
)
|
||||
).rows[0][0]
|
||||
counts[table] = table_count
|
||||
except InterruptedError:
|
||||
# In some cases I saw "SQL Logic Error" here in addition to
|
||||
# InterruptedError - so we catch that too:
|
||||
except (InterruptedError, sqlite3.OperationalError):
|
||||
counts[table] = None
|
||||
if not self.is_mutable:
|
||||
self.cached_table_counts = counts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue