From c9e727b2bcd18db95527e3c97538501bde08cf56 Mon Sep 17 00:00:00 2001 From: Akarsh Singhal <83413214+akarshsinghal@users.noreply.github.com> Date: Fri, 28 Nov 2025 23:20:50 -0500 Subject: [PATCH] Deprecate Flask.should_ignore_error: emits DeprecationWarning and returns False for backward compatibility --- src/flask/app.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/flask/app.py b/src/flask/app.py index e0c193dc..c14360e3 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -12,6 +12,7 @@ from inspect import iscoroutinefunction from itertools import chain from types import TracebackType from urllib.parse import quote as _url_quote +import warnings import click from werkzeug.datastructures import Headers @@ -1589,3 +1590,19 @@ class Flask(App): wrapped to apply middleware. """ return self.wsgi_app(environ, start_response) + + def should_ignore_error(self, error): + """ + Deprecated: this method is no longer meaningful in Flask's current + context preservation design. It will be removed in a future release. + + Kept for backwards compatibility — it always returns False. + """ + import warnings + warnings.warn( + "Flask.should_ignore_error is deprecated and will be removed in a " + "future release. It currently always returns False and should not be used.", + DeprecationWarning, + stacklevel=2, + ) + return False