Fix showing a suitable error page for diffs with internal errors.

Review Request #7427 — Created June 15, 2015 and submitted

Information

Review Board
release-2.0.x
33d433c...

Reviewers

When hitting an internal error, we'd attempt to render the diff viewer
page with the error information. This ended up breaking though, since
later in the page, the JavaScript block would try to access context
variables that didn't exist, causing an entirely different error to
display.

We no longer execute that section of the block when showing an error,
allowing the error information to show through.

I've also cleaned up the presentation just a bit so that it's not
completely meaningless, and so that we don't show the traceback unless
it's being viewed by a superuser. This will help prevent some leakage of
information here, while allowing admins to get the details.

Triggered an error and viewed the page as an admin, as as a normal user.
Saw the two versions of the page. I no longer got the Django traceback
about the context variables.

Description From Last Updated

if 0 ?

brenniebrennie
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
    
    
  2. 
      
brennie
  1. 
      
  2. Show all issues

    if 0 ?

    1. Oops, left over from debugging.

  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/templates/diffviewer/view_diff.html (Diff revision 2)
     
     
     
     

    Do we at least put something in the log file for non-superusers?

    1. No, but the superuser can always view the page and see the traceback.

  3. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (f55d5a5)