mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Rename handle_500 to handle_exception, refs #1770
This commit is contained in:
parent
950cc7677f
commit
8188f55efc
1 changed files with 4 additions and 4 deletions
|
|
@ -1275,7 +1275,7 @@ class DatasetteRouter:
|
||||||
except NotFound as exception:
|
except NotFound as exception:
|
||||||
return await self.handle_404(request, send, exception)
|
return await self.handle_404(request, send, exception)
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
return await self.handle_500(request, send, exception)
|
return await self.handle_exception(request, send, exception)
|
||||||
|
|
||||||
async def handle_404(self, request, send, exception=None):
|
async def handle_404(self, request, send, exception=None):
|
||||||
# If path contains % encoding, redirect to tilde encoding
|
# If path contains % encoding, redirect to tilde encoding
|
||||||
|
|
@ -1354,7 +1354,7 @@ class DatasetteRouter:
|
||||||
view_name="page",
|
view_name="page",
|
||||||
)
|
)
|
||||||
except NotFoundExplicit as e:
|
except NotFoundExplicit as e:
|
||||||
await self.handle_500(request, send, e)
|
await self.handle_exception(request, send, e)
|
||||||
return
|
return
|
||||||
# Pull content-type out into separate parameter
|
# Pull content-type out into separate parameter
|
||||||
content_type = "text/html; charset=utf-8"
|
content_type = "text/html; charset=utf-8"
|
||||||
|
|
@ -1369,9 +1369,9 @@ class DatasetteRouter:
|
||||||
content_type=content_type,
|
content_type=content_type,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await self.handle_500(request, send, exception or NotFound("404"))
|
await self.handle_exception(request, send, exception or NotFound("404"))
|
||||||
|
|
||||||
async def handle_500(self, request, send, exception):
|
async def handle_exception(self, request, send, exception):
|
||||||
if self.ds.pdb:
|
if self.ds.pdb:
|
||||||
import pdb
|
import pdb
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue