@@ -435,7 +435,7 @@ def raise_exception_handler(json_input, lambda_context):
435435 0 ,
436436 bootstrap .StandardLogSink (),
437437 )
438- error_logs = "[ERROR] FaultExceptionType: Fault exception msg\n "
438+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last): \ n "
439439
440440 self .assertEqual (mock_stdout .getvalue (), error_logs )
441441
@@ -461,7 +461,7 @@ def raise_exception_handler(json_input, lambda_context):
461461 0 ,
462462 bootstrap .StandardLogSink (),
463463 )
464- error_logs = "[ERROR] FaultExceptionType\n "
464+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last): \ n "
465465
466466 self .assertEqual (mock_stdout .getvalue (), error_logs )
467467
@@ -487,7 +487,7 @@ def raise_exception_handler(json_input, lambda_context):
487487 0 ,
488488 bootstrap .StandardLogSink (),
489489 )
490- error_logs = "[ERROR] Fault exception msg\n "
490+ error_logs = "[ERROR] Fault exception msg\r Traceback (most recent call last): \ n "
491491
492492 self .assertEqual (mock_stdout .getvalue (), error_logs )
493493
@@ -835,7 +835,7 @@ def test_log_error_standard_log_sink(self, mock_stdout):
835835 err_to_log = bootstrap .make_error ("Error message" , "ErrorType" , None )
836836 bootstrap .log_error (err_to_log , bootstrap .StandardLogSink ())
837837
838- expected_logged_error = "[ERROR] ErrorType: Error message\n "
838+ expected_logged_error = "[ERROR] ErrorType: Error message\r Traceback (most recent call last): \ n "
839839 self .assertEqual (mock_stdout .getvalue (), expected_logged_error )
840840
841841 def test_log_error_framed_log_sink (self ):
@@ -844,14 +844,17 @@ def test_log_error_framed_log_sink(self):
844844 err_to_log = bootstrap .make_error ("Error message" , "ErrorType" , None )
845845 bootstrap .log_error (err_to_log , log_sink )
846846
847- expected_logged_error = "[ERROR] ErrorType: Error message"
847+ expected_logged_error = "[ERROR] ErrorType: Error message\n Traceback (most recent call last): "
848848
849849 with open (temp_file .name , "rb" ) as f :
850850 content = f .read ()
851851
852852 frame_type = int .from_bytes (content [:4 ], "big" )
853853 self .assertEqual (frame_type , 0xA55A0001 )
854854
855+ actual_message = content [8 :].decode ()
856+ self .assertEqual (actual_message , expected_logged_error )
857+
855858 length = int .from_bytes (content [4 :8 ], "big" )
856859 self .assertEqual (length , len (expected_logged_error .encode ("utf8" )))
857860
0 commit comments