Skip to content

Commit 1bd2c6a

Browse files
committed
Apply cursor's suggestions
1 parent 357be37 commit 1bd2c6a

File tree

2 files changed

+3
-7
lines changed
  • dev-packages/e2e-tests/test-applications/node-fastify-5/tests
  • packages/node/src/integrations/tracing/fastify

2 files changed

+3
-7
lines changed

dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ test('Does not send error when shouldHandleError returns false', async ({ baseUR
3939
// Wait for a short time to ensure no error is sent
4040
await new Promise(resolve => setTimeout(resolve, 1000));
4141

42-
expect(errorEventPromise).rejects.toBeDefined();
42+
await expect(errorEventPromise).rejects.toBeDefined();
4343
});

packages/node/src/integrations/tracing/fastify/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,7 @@ function handleFastifyError(
105105

106106
export const instrumentFastify = generateInstrumentOnce(
107107
INTEGRATION_NAME,
108-
(
109-
options: Partial<FastifyHandlerOptions> = {
110-
shouldHandleError: defaultShouldHandleError,
111-
},
112-
) => {
108+
(options: Partial<FastifyHandlerOptions> = {}) => {
113109
const fastifyOtelInstrumentationInstance = new FastifyOtelInstrumentation();
114110
const plugin = fastifyOtelInstrumentationInstance.plugin();
115111

@@ -144,7 +140,7 @@ export const instrumentFastify = generateInstrumentOnce(
144140
error,
145141
request,
146142
reply,
147-
options.shouldHandleError,
143+
options?.shouldHandleError || defaultShouldHandleError,
148144
'diagnostics-channel',
149145
);
150146
});

0 commit comments

Comments
 (0)