@@ -489,11 +489,7 @@ def raise_exception_handler(json_input, lambda_context):
489
489
)
490
490
491
491
# NOTE: Indentation characters are NO-BREAK SPACE (U+00A0) not SPACE (U+0020)
492
- error_logs = (
493
- lambda_unhandled_exception_warning_message
494
- + "\n "
495
- + "[ERROR] FaultExceptionType: Fault exception msg\r "
496
- )
492
+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r "
497
493
error_logs += "Traceback (most recent call last):\r "
498
494
error_logs += ' File "spam.py", line 3, in <module>\r '
499
495
error_logs += " spam.eggs()\r "
@@ -527,11 +523,7 @@ def raise_exception_handler(json_input, lambda_context):
527
523
"tenant_id" ,
528
524
bootstrap .StandardLogSink (),
529
525
)
530
- error_logs = (
531
- lambda_unhandled_exception_warning_message
532
- + "\n "
533
- + "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last):\n "
534
- )
526
+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last):\n "
535
527
536
528
self .assertEqual (mock_stdout .getvalue (), error_logs )
537
529
@@ -560,11 +552,7 @@ def raise_exception_handler(json_input, lambda_context):
560
552
"tenant_id" ,
561
553
bootstrap .StandardLogSink (),
562
554
)
563
- error_logs = (
564
- lambda_unhandled_exception_warning_message
565
- + "\n "
566
- + "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
567
- )
555
+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
568
556
569
557
self .assertEqual (mock_stdout .getvalue (), error_logs )
570
558
@@ -593,11 +581,7 @@ def raise_exception_handler(json_input, lambda_context):
593
581
"tenant_id" ,
594
582
bootstrap .StandardLogSink (),
595
583
)
596
- error_logs = (
597
- lambda_unhandled_exception_warning_message
598
- + "\n "
599
- + "[ERROR] Fault exception msg\r Traceback (most recent call last):\n "
600
- )
584
+ error_logs = "[ERROR] Fault exception msg\r Traceback (most recent call last):\n "
601
585
602
586
self .assertEqual (mock_stdout .getvalue (), error_logs )
603
587
@@ -635,7 +619,7 @@ def raise_exception_handler(json_input, lambda_context):
635
619
"tenant_id" ,
636
620
bootstrap .StandardLogSink (),
637
621
)
638
- error_logs = lambda_unhandled_exception_warning_message + " \n [ERROR]\r "
622
+ error_logs = " [ERROR]\r "
639
623
error_logs += "Traceback (most recent call last):\r "
640
624
error_logs += ' File "spam.py", line 3, in <module>\r '
641
625
error_logs += " spam.eggs()\r "
@@ -671,21 +655,11 @@ def raise_exception_handler(json_input, lambda_context):
671
655
)
672
656
673
657
stdout_value = mock_stdout .getvalue ()
674
- received_warning = stdout_value .split ("\n " )[0 ]
675
- received_rest = stdout_value [len (received_warning ) + 1 :]
676
-
677
- warning = json .loads (received_warning )
678
- self .assertEqual (warning ["level" ], "WARNING" )
679
- self .assertEqual (warning ["message" ], lambda_unhandled_exception_warning_message )
680
- self .assertEqual (warning ["logger" ], "root" )
681
- self .assertIn ("timestamp" , warning )
682
658
683
659
# this line is not in json because of the way the test runtime is bootstrapped
684
- error_logs = (
685
- "\n [ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
686
- )
660
+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
687
661
688
- self .assertEqual (received_rest , error_logs )
662
+ self .assertEqual (stdout_value , error_logs )
689
663
690
664
691
665
class TestXrayFault (unittest .TestCase ):
0 commit comments