#24619: Technical error responses (404 and 500) should return responses 
dependent
on Accept header
---------------------------------+-------------------------------------
     Reporter:  Marcin Nowak     |                    Owner:  nobody
         Type:  New feature      |                   Status:  closed
    Component:  Error reporting  |                  Version:  master
     Severity:  Normal           |               Resolution:  duplicate
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 As Claude says, better content negotiation is a work in progress.

 I think the vast majority of this ticket covers 500 responses. #30752
 (Django 3.1) allows providing a custom ExceptionReporter sublcass. That
 will be the place to add the logic needed to return the desired response
 format.

 Doing similar for 404s would require a rewrite of the handler to use a
 reporter class, similar to the 500 case. I don't think that's in scope for
 this issue. If there's a genuine demand for that, happy to see it
 suggested in a separate ticket. But... given the age of this one, I
 suspect most (all?) users are using DRF for this kind of case these days,
 and that there is, in fact, no demand for this change.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/24619#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2fc595231ddc2394780091cce2e0419e%40djangoproject.com.

Reply via email to