Opened 13 years ago
Closed 12 years ago
#16227 closed New feature (wontfix)
Include traceback in a comment when hitting an exception in debug mode
Reported by: | Daniel Watkins | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | djangoproject.com@…, Daniel Watkins, anton@…, philipkimmey, oliver@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
As discussed on the mailing list, debugging can be a real pain using curl or when dealing with AJAX, as one has to manually parse the HTML.
It would be better if the traceback could be provided in an HTML comment near the top of the file, as this will not impact the normal display at all, but make debugging in these cases a vastly more pleasant experience.
Attachments (1)
Change History (14)
by , 13 years ago
Attachment: | traceback-in-comment.patch added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|
comment:3 by , 13 years ago
Cc: | added |
---|
comment:4 by , 13 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|---|
UI/UX: | set |
comment:5 by , 13 years ago
Cc: | added |
---|
comment:6 by , 13 years ago
Type: | Uncategorized → New feature |
---|
comment:7 by , 13 years ago
I've been thinking about this one quite a bit, and my suspicion is the most common inconvenience is seeing the full HTML dump when making AJAX requests.
I'm curious how commonly people are using curl (or similar methods).
At least personally, maybe 35% of the time I see an error message it's in Chrome's debug console.
My personal preference would be to simply have massively simplified templates (e.g. not HTML) for the common case of AJAX requests. We could have inline TECHNICAL_AJAX_*_TEMPLATE or something along those lines. Then we can just use request.is_ajax() to choose the template.
Although it doesn't resolve the case of using curl, if AJAX is the common case, I think it would be worth the minor increase in complexity.
If there is interest in something along these lines, I would be happy to contribute a patch.
comment:8 by , 13 years ago
Cc: | added |
---|
comment:10 by , 13 years ago
Cc: | added |
---|---|
Resolution: | duplicate |
Status: | closed → reopened |
I'm reopening this as I think the scope of this is different to #10841.
While that helps a great deal for debugging AJAX requests, it still doesn't cover the case where the requests aren't AJAX, but your client is still not a browser; for instance, when debugging a REST API (when you're almost certainly going to be using command-line tools to test things).
I think it's be very helpful to include a standard-format traceback at the bottom of the document in a HTML comment; it would make debugging vastly easier. For what it's worth, this is something other frameworks are already doing (Flask springs to mind). Given how simple this is to implement, and in view that it wouldn't have any chance of introducing problems – there is already a standard-format traceback in the copy-and-paste view half way up the page after all – I think it's a total no-brainer.
comment:11 by , 13 years ago
Component: | Uncategorized → Core (Other) |
---|
comment:12 by , 12 years ago
Status: | reopened → new |
---|
comment:13 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think we don't need a feature like this, with the LOGGING framework you can easily add a console handler to 'django.request' and get a trace in the runserver console.
https://groups.google.com/forum/#!topic/django-developers/aQtKMRxdTHM link to the discussion