Code

Opened 2 years ago

Last modified 7 weeks ago

#18229 new New feature

Allow configuration of debug response format for AJAX errors

Reported by: davehughes05@… Owned by: nobody
Component: Core (Other) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The plaintext error responses for AJAX requests in 1.4 drop a lot of the stack trace context that was included in the HTML responses pre-1.4. Tools like the network response 'Preview' viewer in Chrome make it easy to navigate the HTML response to drill down into the richer context it provides. The pull request linked below maintains the 1.4 default but enables the response to be configured to use the original behavior.

https://github.com/django/django/pull/8

Attachments (0)

Change History (9)

comment:1 Changed 2 years ago by davehughes05@…

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 2 years ago by adrian

I agree we should allow this somehow for Chrome, but I'd prefer not to add yet another setting. The barrier to entry for settings is higher. Can you think of another way to solve it?

comment:3 Changed 2 years ago by davehughes05@…

I can't think of an alternative that allows both behaviors without configuring which one is preferred, short of reading the developer's mind :-)

Expanding the returned plaintext to include contextual code and serialized variables (the way they appear in the HTML error result) would probably solve the issue for me. This information could be presented toward the bottom of the trace so the summarizing information is more prominent.

This would likely involve a more in-depth patch, but wouldn't require adding yet another setting. Is this approach worth pursuing, in your opinion?

comment:4 Changed 2 years ago by adrian

Dave -- Sure, improving the text version to include the contextual code and variables sounds like the better plan. I agree that information should appear at the bottom, to present the most important stuff first. Have a go at implementing it!

comment:5 Changed 2 years ago by jezdez

  • Triage Stage changed from Unreviewed to Accepted

Marking as accepted as there has apparently been an understanding about the issue already.

comment:6 Changed 11 months ago by Kamu

  • Has patch unset

Removing has patch because the pull request was closed in preference of another implementation.

comment:7 Changed 8 months ago by FunkyBob

Which other implementation was chosen?

Is there a separate ticket for it?

Should this be closed as a dupe or fixed?

comment:8 Changed 7 months ago by timo

  • Easy pickings unset
  • Needs documentation unset

I think the implementation chosen was "improving the text version to include the contextual code and variables sounds". I don't think it has been implemented yet.

comment:9 Changed 7 weeks ago by anubhav9042

I hope/intend to work on this in gsoc.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.