Method: flask.app.Flask.raise_routing_exception
Calls: 33, Exceptions: 33, Paths: 4Back
Path 1: 30 calls (0.91)
Request (30)
MethodNotAllowed (14) NotFound (14) BadHost (1) RequestRedirect (1)
1def raise_routing_exception(self, request: Request) -> t.NoReturn:
2 """Intercept routing exceptions and possibly do something else.
3
4 In debug mode, intercept a routing redirect and replace it with
5 an error if the body will be discarded.
6
7 With modern Werkzeug this shouldn't occur, since it now uses a
8 308 status which tells the browser to resend the method and
9 body.
10
11 .. versionchanged:: 2.1
12 Don't intercept 307 and 308 redirects.
13
14 :meta private:
15 :internal:
16 """
17 if (
18 not self.debug
19 or not isinstance(request.routing_exception, RequestRedirect)
20 or request.routing_exception.code in {307, 308}
21 or request.method in {"GET", "HEAD", "OPTIONS"}
22 ):
23 raise request.routing_exception # type: ignore
24
25 from .debughelpers import FormDataRoutingRedirect
26
27 raise FormDataRoutingRedirect(request)
Path 2: 1 calls (0.03)
Request (1)
RequestRedirect (1)
1def raise_routing_exception(self, request: Request) -> t.NoReturn:
2 """Intercept routing exceptions and possibly do something else.
3
4 In debug mode, intercept a routing redirect and replace it with
5 an error if the body will be discarded.
6
7 With modern Werkzeug this shouldn't occur, since it now uses a
8 308 status which tells the browser to resend the method and
9 body.
10
11 .. versionchanged:: 2.1
12 Don't intercept 307 and 308 redirects.
13
14 :meta private:
15 :internal:
16 """
17 if (
18 not self.debug
19 or not isinstance(request.routing_exception, RequestRedirect)
20 or request.routing_exception.code in {307, 308}
21 or request.method in {"GET", "HEAD", "OPTIONS"}
22 ):
23 raise request.routing_exception # type: ignore
24
25 from .debughelpers import FormDataRoutingRedirect
26
27 raise FormDataRoutingRedirect(request)
Path 3: 1 calls (0.03)
Request (1)
FormDataRoutingRedirect (1)
1def raise_routing_exception(self, request: Request) -> t.NoReturn:
2 """Intercept routing exceptions and possibly do something else.
3
4 In debug mode, intercept a routing redirect and replace it with
5 an error if the body will be discarded.
6
7 With modern Werkzeug this shouldn't occur, since it now uses a
8 308 status which tells the browser to resend the method and
9 body.
10
11 .. versionchanged:: 2.1
12 Don't intercept 307 and 308 redirects.
13
14 :meta private:
15 :internal:
16 """
17 if (
18 not self.debug
19 or not isinstance(request.routing_exception, RequestRedirect)
20 or request.routing_exception.code in {307, 308}
21 or request.method in {"GET", "HEAD", "OPTIONS"}
22 ):
23 raise request.routing_exception # type: ignore
24
25 from .debughelpers import FormDataRoutingRedirect
26
27 raise FormDataRoutingRedirect(request)
Path 4: 1 calls (0.03)
Request (1)
MethodNotAllowed (1)
1def raise_routing_exception(self, request: Request) -> t.NoReturn:
2 """Intercept routing exceptions and possibly do something else.
3
4 In debug mode, intercept a routing redirect and replace it with
5 an error if the body will be discarded.
6
7 With modern Werkzeug this shouldn't occur, since it now uses a
8 308 status which tells the browser to resend the method and
9 body.
10
11 .. versionchanged:: 2.1
12 Don't intercept 307 and 308 redirects.
13
14 :meta private:
15 :internal:
16 """
17 if (
18 not self.debug
19 or not isinstance(request.routing_exception, RequestRedirect)
20 or request.routing_exception.code in {307, 308}
21 or request.method in {"GET", "HEAD", "OPTIONS"}
22 ):
23 raise request.routing_exception # type: ignore
24
25 from .debughelpers import FormDataRoutingRedirect
26
27 raise FormDataRoutingRedirect(request)