Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as Sentry from '@sentry/react';

import ImageViewer from 'sentry/components/events/attachmentViewers/imageViewer';
import JsonViewer from 'sentry/components/events/attachmentViewers/jsonViewer';
import LogFileViewer from 'sentry/components/events/attachmentViewers/logFileViewer';
Expand Down Expand Up @@ -61,12 +59,6 @@ export const getInlineAttachmentRenderer = (
return WebMViewer;
}

Sentry.withScope(scope => {
scope.setExtra('mimetype', attachment.mimetype);
scope.setExtra('attachmentName', attachment.name);
scope.setFingerprint(['no-inline-attachment-renderer']);
scope.captureException(new Error('No inline attachment renderer found'));
});
return undefined;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {ComponentProps} from 'react';
import {Fragment, useCallback, useMemo, useState} from 'react';
import {Fragment, useCallback, useEffect, useMemo, useState} from 'react';
import {css} from '@emotion/react';
import styled from '@emotion/styled';
import * as Sentry from '@sentry/react';

import type {ModalRenderProps} from 'sentry/actionCreators/modal';
import Confirm from 'sentry/components/confirm';
Expand Down Expand Up @@ -107,6 +108,17 @@ export default function ScreenshotModal({

const AttachmentComponent = getInlineAttachmentRenderer(currentEventAttachment)!;

useEffect(() => {
if (currentEventAttachment && !AttachmentComponent) {
Sentry.withScope(scope => {
scope.setExtra('mimetype', currentEventAttachment.mimetype);
scope.setExtra('attachmentName', currentEventAttachment.name);
scope.setFingerprint(['no-inline-attachment-renderer']);
scope.captureException(new Error('No screenshot attachment renderer found'));
});
}
}, [currentEventAttachment, AttachmentComponent]);

return (
<Fragment>
<Header closeButton>
Expand Down
Loading