Opened 3 weeks ago

Closed 3 weeks ago

Last modified 2 weeks ago

#36790 closed New feature (wontfix)

Add a generic error view handler

Reported by: Wes P. Owned by:
Component: HTTP handling Version: 6.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (2)

comment:1 by Jacob Walls, 3 weeks ago

Resolution: wontfix
Status: newclosed
Summary: Refactor error view handlers to be genericAdd a generic error view handler
Type: Cleanup/optimizationNew feature

Thanks, I think this idea has a lot of merit. Now, for the paperwork. The process we've been trialing for most of 2025 to funnel new features into a place where the community can see and prioritize them is to open an issue at https://github.com/django/new-features.

I agree with you about reducing the scope of #35281, so I will comment there.

But for this issue, this needs a design, maybe even an express-DEP (we've been talking about how to make that process less frictionful, more enjoyable). First step there is to get eyes on it in the new features board. Then we can reopen here.

Our pick list has no better option than "wontfix" right now, but as I said the idea has merit, and a new-features issue would be helpful. Thanks.

comment:2 by Wes P., 2 weeks ago

I opened the issue on the new-features repo: https://github.com/django/new-features/issues/104

Note: See TracTickets for help on using tickets.
Back to Top