File tree 4 files changed +12
-6
lines changed
4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,8 @@ class Tracer extends Utility implements TracerInterface {
410
410
subsegment ?. close ( ) ;
411
411
} catch ( error ) {
412
412
console . warn (
413
- `Failed to close or serialize segment, ${ subsegment ?. name } . We are catching the error but data might be lost.` ,
413
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
414
+ subsegment ?. name ,
414
415
error
415
416
) ;
416
417
}
@@ -499,7 +500,8 @@ class Tracer extends Utility implements TracerInterface {
499
500
subsegment ?. close ( ) ;
500
501
} catch ( error ) {
501
502
console . warn (
502
- `Failed to close or serialize segment, ${ subsegment ?. name } . We are catching the error but data might be lost.` ,
503
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
504
+ subsegment ?. name ,
503
505
error
504
506
) ;
505
507
}
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ const captureLambdaHandler = (
74
74
handlerSegment . close ( ) ;
75
75
} catch ( error ) {
76
76
console . warn (
77
- `Failed to close or serialize segment, ${ handlerSegment . name } . We are catching the error but data might be lost.` ,
77
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
78
+ handlerSegment . name ,
78
79
error
79
80
) ;
80
81
}
Original file line number Diff line number Diff line change @@ -953,7 +953,8 @@ describe('Class: Tracer', () => {
953
953
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
954
954
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
955
955
1 ,
956
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
956
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
957
+ handlerSubsegment . name ,
957
958
new Error ( 'dummy error' )
958
959
) ;
959
960
} ) ;
@@ -1414,7 +1415,8 @@ describe('Class: Tracer', () => {
1414
1415
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1415
1416
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
1416
1417
1 ,
1417
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
1418
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
1419
+ handlerSubsegment . name ,
1418
1420
new Error ( 'dummy error' )
1419
1421
) ;
1420
1422
} ) ;
Original file line number Diff line number Diff line change @@ -405,7 +405,8 @@ describe('Middy middleware', () => {
405
405
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
406
406
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
407
407
1 ,
408
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
408
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
409
+ handlerSubsegment . name ,
409
410
new Error ( 'dummy error' )
410
411
) ;
411
412
// Check that the segments are restored
You can’t perform that action at this time.
0 commit comments