[Django] #36790: Refactor error view handlers to be generic

0 views
Skip to first unread message

Django

unread,
Dec 10, 2025, 4:34:03 PM12/10/25
to django-...@googlegroups.com
#36790: Refactor error view handlers to be generic
------------------------+------------------------------------------------
Reporter: Wes P. | Type: Cleanup/optimization
Status: new | Component: HTTP handling
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------------------
In a PR review discussion (see:
https://github.com/django/django/pull/17960/files) which was reviewing
ticket #35281 (adding a new handler for 413 errors) it was expressed that
there should be a better way to allow developers to access handlers
instead of creating handlers for every kind of 4xx or 5xx error: a generic
method. Ticket #35281 switched from being about a 413 handler (fairly
easy) to refactoring error view handlers.

I would like ticket #35281 to revert to being about handling 413 errors
(which was accepted) and for this ticket to be about refactoring error
view handlers to be generic. I would also recommend that we preserve
backward compatibility without deprecating the existing handlers.

Documentation for error views:
https://docs.djangoproject.com/en/6.0/ref/views/#error-views
--
Ticket URL: <https://code.djangoproject.com/ticket/36790>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages