Skip to content

Commit

Permalink
Rename handle_500 to handle_exception, refs #1770
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 17, 2022
1 parent 950cc76 commit 8188f55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datasette/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ async def route_path(self, scope, receive, send, path):
except NotFound as exception:
return await self.handle_404(request, send, 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):
# If path contains % encoding, redirect to tilde encoding
Expand Down Expand Up @@ -1354,7 +1354,7 @@ def raise_404(message=""):
view_name="page",
)
except NotFoundExplicit as e:
await self.handle_500(request, send, e)
await self.handle_exception(request, send, e)
return
# Pull content-type out into separate parameter
content_type = "text/html; charset=utf-8"
Expand All @@ -1369,9 +1369,9 @@ def raise_404(message=""):
content_type=content_type,
)
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:
import pdb

Expand Down

0 comments on commit 8188f55

Please sign in to comment.