mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #33747 -- Added exception notes to the technical 500 debug page.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							70c945d6b3
						
					
				
				
					commit
					80c66e40f7
				
			| @@ -396,6 +396,8 @@ class ExceptionReporter: | ||||
|             c["exception_type"] = self.exc_type.__name__ | ||||
|         if self.exc_value: | ||||
|             c["exception_value"] = str(self.exc_value) | ||||
|             if exc_notes := getattr(self.exc_value, "__notes__", None): | ||||
|                 c["exception_notes"] = "\n" + "\n".join(exc_notes) | ||||
|         if frames: | ||||
|             c["lastframe"] = frames[-1] | ||||
|         return c | ||||
|   | ||||
| @@ -100,7 +100,7 @@ | ||||
| <div id="summary"> | ||||
|   <h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %} | ||||
|       {% if request %} at {{ request.path_info }}{% endif %}</h1> | ||||
|   <pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception message supplied{% endif %}</pre> | ||||
|   <pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %}{% else %}No exception message supplied{% endif %}</pre> | ||||
|   <table class="meta"> | ||||
| {% if request %} | ||||
|     <tr> | ||||
| @@ -330,7 +330,7 @@ During handling of the above exception ({{ frame.exc_cause|force_escape }}), ano | ||||
| {% if frame.context_line %}    {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% elif forloop.first %}None{% else %}Traceback: None{% endif %}{% endfor %} | ||||
|  | ||||
| Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} | ||||
| Exception Value: {{ exception_value|force_escape }} | ||||
| Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %} | ||||
| </textarea> | ||||
|   <br><br> | ||||
|   <input type="submit" value="Share this traceback on a public website"> | ||||
|   | ||||
| @@ -34,7 +34,7 @@ Traceback (most recent call last): | ||||
| {% if frame.context_line %}    {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% elif forloop.first %}None{% else %}Traceback: None{% endif %} | ||||
| {% endfor %} | ||||
| {% if exception_type %}Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} | ||||
| {% if exception_value %}Exception Value: {{ exception_value }}{% endif %}{% endif %}{% endif %} | ||||
| {% if exception_value %}Exception Value: {{ exception_value }}{% endif %}{% if exception_notes %}{{ exception_notes }}{% endif %}{% endif %}{% endif %} | ||||
| {% if raising_view_name %}Raised during: {{ raising_view_name }}{% endif %} | ||||
| {% if request %}Request information: | ||||
| {% if user_str %}USER: {{ user_str }}{% endif %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user