mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Do not show database name in Database Not Found error, refs #2359
This commit is contained in:
parent
93534fd3d0
commit
62686114ee
3 changed files with 4 additions and 6 deletions
|
|
@ -1617,9 +1617,7 @@ class Datasette:
|
|||
try:
|
||||
return self.get_database(route=database_route)
|
||||
except KeyError:
|
||||
raise DatabaseNotFound(
|
||||
"Database not found: {}".format(database_route), database_route
|
||||
)
|
||||
raise DatabaseNotFound(database_route)
|
||||
|
||||
async def resolve_table(self, request):
|
||||
db = await self.resolve_database(request)
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class NotFound(Base400):
|
|||
|
||||
|
||||
class DatabaseNotFound(NotFound):
|
||||
def __init__(self, message, database_name):
|
||||
super().__init__(message)
|
||||
def __init__(self, database_name):
|
||||
self.database_name = database_name
|
||||
super().__init__("Database not found")
|
||||
|
||||
|
||||
class TableNotFound(NotFound):
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ async def test_insert_rows(ds_write, return_rows):
|
|||
{},
|
||||
None,
|
||||
404,
|
||||
["Database not found: data2"],
|
||||
["Database not found"],
|
||||
),
|
||||
(
|
||||
"/data/docs2/-/insert",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue