Skip to content

fix(node): Skip capturing Hapi Boom responses v8. #12288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/node/src/integrations/tracing/hapi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { logger } from '@sentry/utils';
import { DEBUG_BUILD } from '../../../debug-build';
import { generateInstrumentOnce } from '../../../otel/instrument';
import { ensureIsWrapped } from '../../../utils/ensureIsWrapped';
import type { Boom, RequestEvent, ResponseObject, Server } from './types';
import type { RequestEvent, Server } from './types';

const INTEGRATION_NAME = 'Hapi';

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

function isBoomObject(response: ResponseObject | Boom): response is Boom {
return response && (response as Boom).isBoom !== undefined;
}

function isErrorEvent(event: RequestEvent): event is RequestEvent {
return event && (event as RequestEvent).error !== undefined;
}
Expand Down Expand Up @@ -76,9 +72,7 @@ export const hapiErrorPlugin = {
logger.warn('Isolation scope is still the default isolation scope - skipping setting transactionName');
}

if (request.response && isBoomObject(request.response)) {
sendErrorToSentry(request.response);
} else if (isErrorEvent(event)) {
if (isErrorEvent(event)) {
sendErrorToSentry(event.error);
}
});
Expand Down
Loading