Skip to content

Commit 48b0a35

Browse files
authored
fix(node): Skip capturing Hapi Boom responses v8. (#12288)
Recreating #11151 for v8 again, as the updates seem to be lost when moving the instrumentation inside the project structure. The testing updates introduced in the original PR do exist in develop / master, so this PR only reintroduces changes in the instrumentation code.
1 parent b4332c1 commit 48b0a35

File tree

1 file changed

+2
-8
lines changed
  • packages/node/src/integrations/tracing/hapi

1 file changed

+2
-8
lines changed

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { logger } from '@sentry/utils';
1515
import { DEBUG_BUILD } from '../../../debug-build';
1616
import { generateInstrumentOnce } from '../../../otel/instrument';
1717
import { ensureIsWrapped } from '../../../utils/ensureIsWrapped';
18-
import type { Boom, RequestEvent, ResponseObject, Server } from './types';
18+
import type { RequestEvent, Server } from './types';
1919

2020
const INTEGRATION_NAME = 'Hapi';
2121

@@ -38,10 +38,6 @@ const _hapiIntegration = (() => {
3838
*/
3939
export const hapiIntegration = defineIntegration(_hapiIntegration);
4040

41-
function isBoomObject(response: ResponseObject | Boom): response is Boom {
42-
return response && (response as Boom).isBoom !== undefined;
43-
}
44-
4541
function isErrorEvent(event: RequestEvent): event is RequestEvent {
4642
return event && (event as RequestEvent).error !== undefined;
4743
}
@@ -76,9 +72,7 @@ export const hapiErrorPlugin = {
7672
logger.warn('Isolation scope is still the default isolation scope - skipping setting transactionName');
7773
}
7874

79-
if (request.response && isBoomObject(request.response)) {
80-
sendErrorToSentry(request.response);
81-
} else if (isErrorEvent(event)) {
75+
if (isErrorEvent(event)) {
8276
sendErrorToSentry(event.error);
8377
}
8478
});

0 commit comments

Comments
 (0)