mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	test_classes: Refine assert_json_success output with exception chaining.
Now a failure from assert_json_success and friends shows the full
server-side traceback from the JsonableError that caused the failure,
not just the test-side traceback for `AssertionError: 400 != 200 :
{message}`.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							3319a192d4
						
					
				
				
					commit
					7143e6910d
				
			@@ -392,7 +392,9 @@ class JsonErrorHandler(MiddlewareMixin):
 | 
			
		||||
                # just return the response without logging further.
 | 
			
		||||
                return response
 | 
			
		||||
        elif RequestNotes.get_notes(request).error_format == "JSON" and not settings.TEST_SUITE:
 | 
			
		||||
            response = json_response(res_type="error", msg=_("Internal server error"), status=500)
 | 
			
		||||
            response = json_response(
 | 
			
		||||
                res_type="error", msg=_("Internal server error"), status=500, exception=exception
 | 
			
		||||
            )
 | 
			
		||||
        else:
 | 
			
		||||
            return None
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user