File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -428,9 +428,12 @@ class Tracer extends Utility implements TracerInterface {
428
428
const tracerRef = this ;
429
429
// Use a function() {} instead of an () => {} arrow function so that we can
430
430
// access `myClass` as `this` in a decorated `myClass.myMethod()`.
431
- descriptor . value = function ( this : Handler , event , context , callback ) {
431
+ descriptor . value = function (
432
+ this : Handler ,
433
+ ...args : Parameters < Handler >
434
+ ) {
432
435
if ( ! tracerRef . isTracingEnabled ( ) ) {
433
- return originalMethod . apply ( this , [ event , context , callback ] ) ;
436
+ return originalMethod . apply ( this , args ) ;
434
437
}
435
438
436
439
return tracerRef . provider . captureAsyncFunc (
@@ -440,11 +443,7 @@ class Tracer extends Utility implements TracerInterface {
440
443
tracerRef . addServiceNameAnnotation ( ) ;
441
444
let result : unknown ;
442
445
try {
443
- result = await originalMethod . apply ( this , [
444
- event ,
445
- context ,
446
- callback ,
447
- ] ) ;
446
+ result = await originalMethod . apply ( this , args ) ;
448
447
if ( options ?. captureResponse ?? true ) {
449
448
tracerRef . addResponseAsMetadata ( result , process . env . _HANDLER ) ;
450
449
}
You can’t perform that action at this time.
0 commit comments