@@ -435,7 +435,7 @@ def raise_exception_handler(json_input, lambda_context):
435
435
0 ,
436
436
bootstrap .StandardLogSink (),
437
437
)
438
- error_logs = "[ERROR] FaultExceptionType: Fault exception msg\n "
438
+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last): \ n "
439
439
440
440
self .assertEqual (mock_stdout .getvalue (), error_logs )
441
441
@@ -461,7 +461,7 @@ def raise_exception_handler(json_input, lambda_context):
461
461
0 ,
462
462
bootstrap .StandardLogSink (),
463
463
)
464
- error_logs = "[ERROR] FaultExceptionType\n "
464
+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last): \ n "
465
465
466
466
self .assertEqual (mock_stdout .getvalue (), error_logs )
467
467
@@ -487,7 +487,7 @@ def raise_exception_handler(json_input, lambda_context):
487
487
0 ,
488
488
bootstrap .StandardLogSink (),
489
489
)
490
- error_logs = "[ERROR] Fault exception msg\n "
490
+ error_logs = "[ERROR] Fault exception msg\r Traceback (most recent call last): \ n "
491
491
492
492
self .assertEqual (mock_stdout .getvalue (), error_logs )
493
493
@@ -835,7 +835,7 @@ def test_log_error_standard_log_sink(self, mock_stdout):
835
835
err_to_log = bootstrap .make_error ("Error message" , "ErrorType" , None )
836
836
bootstrap .log_error (err_to_log , bootstrap .StandardLogSink ())
837
837
838
- expected_logged_error = "[ERROR] ErrorType: Error message\n "
838
+ expected_logged_error = "[ERROR] ErrorType: Error message\r Traceback (most recent call last): \ n "
839
839
self .assertEqual (mock_stdout .getvalue (), expected_logged_error )
840
840
841
841
def test_log_error_framed_log_sink (self ):
@@ -844,14 +844,17 @@ def test_log_error_framed_log_sink(self):
844
844
err_to_log = bootstrap .make_error ("Error message" , "ErrorType" , None )
845
845
bootstrap .log_error (err_to_log , log_sink )
846
846
847
- expected_logged_error = "[ERROR] ErrorType: Error message"
847
+ expected_logged_error = "[ERROR] ErrorType: Error message\n Traceback (most recent call last): "
848
848
849
849
with open (temp_file .name , "rb" ) as f :
850
850
content = f .read ()
851
851
852
852
frame_type = int .from_bytes (content [:4 ], "big" )
853
853
self .assertEqual (frame_type , 0xA55A0001 )
854
854
855
+ actual_message = content [8 :].decode ()
856
+ self .assertEqual (actual_message , expected_logged_error )
857
+
855
858
length = int .from_bytes (content [4 :8 ], "big" )
856
859
self .assertEqual (length , len (expected_logged_error .encode ("utf8" )))
857
860
0 commit comments