raise_routing_exception() — flask Function Reference
Architecture documentation for the raise_routing_exception() function in app.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD ed42e052_3b19_c965_f4bb_2b6c30bb3cbc["raise_routing_exception()"] 9f8cc56e_d5c4_e7a8_438a_3124c0dd5de5["Flask"] ed42e052_3b19_c965_f4bb_2b6c30bb3cbc -->|defined in| 9f8cc56e_d5c4_e7a8_438a_3124c0dd5de5 59b4fb78_3cac_a043_29b8_6e0b8103b575["dispatch_request()"] 59b4fb78_3cac_a043_29b8_6e0b8103b575 -->|calls| ed42e052_3b19_c965_f4bb_2b6c30bb3cbc style ed42e052_3b19_c965_f4bb_2b6c30bb3cbc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/flask/app.py lines 561–587
def raise_routing_exception(self, request: Request) -> t.NoReturn:
"""Intercept routing exceptions and possibly do something else.
In debug mode, intercept a routing redirect and replace it with
an error if the body will be discarded.
With modern Werkzeug this shouldn't occur, since it now uses a
308 status which tells the browser to resend the method and
body.
.. versionchanged:: 2.1
Don't intercept 307 and 308 redirects.
:meta private:
:internal:
"""
if (
not self.debug
or not isinstance(request.routing_exception, RequestRedirect)
or request.routing_exception.code in {307, 308}
or request.method in {"GET", "HEAD", "OPTIONS"}
):
raise request.routing_exception # type: ignore[misc]
from .debughelpers import FormDataRoutingRedirect
raise FormDataRoutingRedirect(request)
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does raise_routing_exception() do?
raise_routing_exception() is a function in the flask codebase, defined in src/flask/app.py.
Where is raise_routing_exception() defined?
raise_routing_exception() is defined in src/flask/app.py at line 561.
What calls raise_routing_exception()?
raise_routing_exception() is called by 1 function(s): dispatch_request.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free