Skip to content

Commit 6369fff

Browse files
committed
Fix update issues
1 parent 7c941e9 commit 6369fff

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function datadog<TEvent, TResult>(
119119
if (finalConfig.enhancedMetrics) {
120120
incrementInvocationsMetric(metricsListener, context);
121121
}
122-
} catch (err) {
122+
} catch (err: any) {
123123
logDebug("Failed to start listeners", err);
124124
}
125125

@@ -156,7 +156,7 @@ export function datadog<TEvent, TResult>(
156156
if (didThrow && finalConfig.enhancedMetrics) {
157157
incrementErrorsMetric(metricsListener, context);
158158
}
159-
} catch (err) {
159+
} catch (err: any) {
160160
logDebug("Failed to complete listeners", err);
161161
}
162162
currentMetricsListener = undefined;

src/metrics/kms-service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe("KMSService", () => {
7878
try {
7979
await kmsService.decrypt(ENCRYPTED_KEY);
8080
fail();
81-
} catch (e) {
81+
} catch (e: any) {
8282
expect(e.message).toEqual(EXPECTED_ERROR_MESSAGE);
8383
}
8484
fakeKmsCall.done();

src/metrics/kms-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class KMSService {
2727
throw Error();
2828
}
2929
return result.Plaintext.toString("ascii");
30-
} catch (err) {
30+
} catch (err: any) {
3131
if (err.code === "MODULE_NOT_FOUND") {
3232
const errorMsg = "optional dependency aws-sdk not installed. KMS key decryption will not work";
3333
logError(errorMsg);

src/metrics/listener.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class MetricsListener {
106106
});
107107
this.statsDClient = undefined;
108108
}
109-
} catch (error) {
109+
} catch (error: any) {
110110
// This can fail for a variety of reasons, from the API not being reachable,
111111
// to KMS key decryption failing.
112112
logError("failed to flush metrics", error);
@@ -116,7 +116,7 @@ export class MetricsListener {
116116
logDebug(`Flushing Extension`);
117117
await flushExtension();
118118
}
119-
} catch (error) {
119+
} catch (error: any) {
120120
logError("failed to flush extension", error);
121121
}
122122
this.currentProcessor = undefined;
@@ -171,7 +171,7 @@ export class MetricsListener {
171171
if (config.apiKeyKMS !== "") {
172172
try {
173173
return await this.kmsClient.decrypt(config.apiKeyKMS);
174-
} catch (error) {
174+
} catch (error: any) {
175175
logError("couldn't decrypt kms api key", error);
176176
}
177177
} else {

src/trace/context.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function extractTraceContext(
5858
try {
5959
trace = extractor(event, context);
6060
logDebug(`extracted trace context from the custom extractor`, { trace });
61-
} catch (error) {
61+
} catch (error: any) {
6262
logError("custom extractor function failed", error);
6363
}
6464
}
@@ -75,7 +75,7 @@ export function extractTraceContext(
7575
if (stepFuncContext) {
7676
try {
7777
addStepFunctionContextToXray(stepFuncContext);
78-
} catch (error) {
78+
} catch (error: any) {
7979
logError("couldn't add step function metadata to xray", error);
8080
}
8181
}
@@ -84,7 +84,7 @@ export function extractTraceContext(
8484
try {
8585
addTraceContextToXray(trace);
8686
logDebug(`added trace context to xray metadata`, { trace });
87-
} catch (error) {
87+
} catch (error: any) {
8888
// This might fail if running in an environment where xray isn't set up, (like for local development).
8989
logError("couldn't add trace context to xray metadata", error);
9090
}
@@ -171,7 +171,7 @@ export function sendXraySubsegment(segment: string) {
171171
client?.close();
172172
logDebug(`Xray daemon received metadata payload`, { error, bytes });
173173
});
174-
} catch (error) {
174+
} catch (error: any) {
175175
client?.close();
176176
logDebug("Error occurred submitting to xray daemon", error);
177177
}
@@ -209,7 +209,7 @@ export function readTraceFromSQSEvent(event: SQSEvent): TraceContext | undefined
209209
};
210210
logDebug(`extracted trace context from sqs event`, { trace, event });
211211
return trace;
212-
} catch (err) {
212+
} catch (err: any) {
213213
logError("Error parsing SQS message trace data", err);
214214
return;
215215
}

src/trace/tracer-wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class TracerWrapper {
2929
const path = require.resolve("dd-trace", { paths: ["/var/task/node_modules", ...module.paths] });
3030
this.tracer = require(path);
3131
return;
32-
} catch (err) {
32+
} catch (err: any) {
3333
logDebug("Couldn't require dd-trace from main", err);
3434
}
3535
}

src/utils/handler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function wrap<TEvent, TResult>(
1818
return async (event: TEvent, context: Context) => {
1919
try {
2020
await onStart(event, context);
21-
} catch (error) {
21+
} catch (error: any) {
2222
// Swallow the error and continue processing.
2323
logError("Pre-lambda hook threw error", error);
2424
}
@@ -30,13 +30,13 @@ export function wrap<TEvent, TResult>(
3030
// handler.
3131
try {
3232
wrappedHandler = onWrap !== undefined ? onWrap(promHandler) : promHandler;
33-
} catch (error) {
33+
} catch (error: any) {
3434
logError("Failed to apply wrap to handler function", error);
3535
}
3636

3737
try {
3838
result = await wrappedHandler(event, context);
39-
} catch (error) {
39+
} catch (error: any) {
4040
handlerError = error;
4141
throw error;
4242
} finally {
@@ -46,7 +46,7 @@ export function wrap<TEvent, TResult>(
4646
} else {
4747
await onComplete(event, context);
4848
}
49-
} catch (error) {
49+
} catch (error: any) {
5050
// Swallow the error and continue processing.
5151
logError("Post-lambda hook threw error", error);
5252
}

0 commit comments

Comments
 (0)