File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 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 {
410410 subsegment ?. close ( ) ;
411411 } catch ( error ) {
412412 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 ,
414415 error
415416 ) ;
416417 }
@@ -501,7 +502,8 @@ class Tracer extends Utility implements TracerInterface {
501502 subsegment ?. close ( ) ;
502503 } catch ( error ) {
503504 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 ,
505507 error
506508 ) ;
507509 }
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ const captureLambdaHandler = (
7474 handlerSegment . close ( ) ;
7575 } catch ( error ) {
7676 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 ,
7879 error
7980 ) ;
8081 }
Original file line number Diff line number Diff line change @@ -1253,7 +1253,8 @@ describe('Class: Tracer', () => {
12531253 expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
12541254 expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
12551255 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 ,
12571258 new Error ( 'dummy error' )
12581259 ) ;
12591260 } ) ;
@@ -1714,7 +1715,8 @@ describe('Class: Tracer', () => {
17141715 expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
17151716 expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
17161717 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 ,
17181720 new Error ( 'dummy error' )
17191721 ) ;
17201722 } ) ;
Original file line number Diff line number Diff line change @@ -391,7 +391,8 @@ describe('Middy middleware', () => {
391391 expect ( closeSpy ) . toHaveBeenCalledTimes ( 1 ) ;
392392 expect ( logWarningSpy ) . toHaveBeenNthCalledWith (
393393 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 ,
395396 new Error ( 'dummy error' )
396397 ) ;
397398 // Check that the segments are restored
You can’t perform that action at this time.
0 commit comments