Rename InterruptedError => QueryInterrupted, closes #490

This commit is contained in:
Simon Willison 2019-05-27 17:16:36 -07:00
commit bd4dbc8519
7 changed files with 20 additions and 20 deletions

View file

@ -14,7 +14,7 @@ from sanic.views import HTTPMethodView
from datasette import __version__
from datasette.plugins import pm
from datasette.utils import (
InterruptedError,
QueryInterrupted,
InvalidSql,
LimitedWriter,
format_bytes,
@ -368,7 +368,7 @@ class BaseView(RenderMixin):
else:
data, extra_template_data, templates = response_or_template_contexts
except InterruptedError:
except QueryInterrupted:
raise DatasetteError(
"""
SQL query took too long. The time limit is controlled by the

View file

@ -9,7 +9,7 @@ from sanic.request import RequestParameters
from datasette.plugins import pm
from datasette.utils import (
CustomRow,
InterruptedError,
QueryInterrupted,
append_querystring,
compound_keys_after_sql,
escape_sqlite,
@ -527,7 +527,7 @@ class TableView(RowTableShared):
await self.ds.execute(database, count_sql, from_sql_params)
)
filtered_table_rows_count = count_rows[0][0]
except InterruptedError:
except QueryInterrupted:
pass
# facets support