kopia lustrzana https://github.com/simonw/datasette
Do not show database name in Database Not Found error, refs #2359
rodzic
93534fd3d0
commit
62686114ee
|
@ -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",
|
||||
|
|
Ładowanie…
Reference in New Issue