#32113: No error at 404 page
-----------------------------------------+------------------------
               Reporter:  lcd1232        |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Uncategorized  |        Version:  3.1
               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              |
-----------------------------------------+------------------------
 It's difficult to find a bug if page has no stack trace or readable error.
 I caught this error if I do not return anything from the context
 processor. It would be great if Django will add a readable error for this
 situation.

 If you have a custom 404 template and page not found then you got 500
 error without understanding why.

 Reproducible application -
 https://gist.github.com/lcd1232/f242d88b1eaeaccbb6ba2e81e68644cd

 One more example of a context processor that can generate the same error:

 {{{
 def url_info(request):
     """
     Adds url info.
     """
     info = resolve(request.path_info) # raised exception for 404 page
     return {
         "url_info": {
             "app_name": info.namespace,
             "url_name": info.url_name,
             "full_name": f"{info.namespace}:{info.url_name}"
         }
     }
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32113>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.5041efd5ec82a5031feee92518ce3d12%40djangoproject.com.

Reply via email to