Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Don't raise an exception , just return None is route is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Dec 21, 2016
1 parent fa541ab commit 1569665
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plone.server/plone/server/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,15 @@ async def real_resolve(self, request):
# Traverse view if its needed
if traverse_to is not None and view is not None:
if not ITraversableView.providedBy(view):
raise HTTPNotFound()
return None
else:
try:
view = view.publishTraverse(traverse_to)
except Exception as e:
logger.error(
"Exception on view execution",
exc_info=e)
raise HTTPNotFound()
return None

if view is None and method == IOPTIONS:
view = DefaultOPTIONS(resource, request)
Expand All @@ -391,7 +391,7 @@ async def real_resolve(self, request):
if rendered is not None:
return MatchInfo(resource, request, view, rendered)
else:
raise HTTPNotFound()
return None

async def traverse(self, request):
"""Wrapper that looks for the path based on aiohttp API."""
Expand Down

0 comments on commit 1569665

Please sign in to comment.