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
}
@@ -501,7 +502,8 @@ class Tracer extends Utility implements TracerInterface {
501
502
subsegment ?. close ( ) ;
502
503
} catch ( error ) {
503
504
console . warn (
504
- `Failed to close or serialize segment, ${ subsegment ?. name } . We are catching the error but data might be lost.` ,
505
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
506
+ subsegment ?. name ,
505
507
error
506
508
) ;
507
509
}
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 @@ -1253,7 +1253,8 @@ describe('Class: Tracer', () => {
1253
1253
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1254
1254
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
1255
1255
1 ,
1256
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
1256
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
1257
+ handlerSubsegment . name ,
1257
1258
new Error ( 'dummy error' )
1258
1259
) ;
1259
1260
} ) ;
@@ -1714,7 +1715,8 @@ describe('Class: Tracer', () => {
1714
1715
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1715
1716
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
1716
1717
1 ,
1717
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
1718
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
1719
+ handlerSubsegment . name ,
1718
1720
new Error ( 'dummy error' )
1719
1721
) ;
1720
1722
} ) ;
Original file line number Diff line number Diff line change @@ -391,7 +391,8 @@ describe('Middy middleware', () => {
391
391
expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
392
392
expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
393
393
1 ,
394
- `Failed to close or serialize segment, ${ handlerSubsegment . name } . We are catching the error but data might be lost.` ,
394
+ `Failed to close or serialize segment %s. We are catching the error but data might be lost.` ,
395
+ handlerSubsegment . name ,
395
396
new Error ( 'dummy error' )
396
397
) ;
397
398
// Check that the segments are restored
You can’t perform that action at this time.
0 commit comments