Add traceback suppressions to commonly shown internals.

This commit is contained in:
L. Karkkainen 2023-02-07 10:58:46 +00:00
parent 526115c3c5
commit da9ff33fa7

View File

@ -39,13 +39,13 @@ class Router(BaseRouter):
extra={"host": host} if host else None,
)
except RoutingNotFound as e:
raise NotFound("Requested URL {} not found".format(e.path))
raise NotFound(f"Requested URL {e.path} not found") from None
except NoMethod as e:
raise MethodNotAllowed(
"Method {} not allowed for URL {}".format(method, path),
f"Method {method} not allowed for URL {path}",
method=method,
allowed_methods=e.allowed_methods,
)
) from None
@lru_cache(maxsize=ROUTER_CACHE_SIZE)
def get( # type: ignore
@ -61,6 +61,7 @@ class Router(BaseRouter):
correct response
:rtype: Tuple[ Route, RouteHandler, Dict[str, Any]]
"""
__tracebackhide__ = True
return self._get(path, method, host)
def add( # type: ignore