Skip to content

Commit

Permalink
fix: speculative change to stop empty error ending up in Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Jan 17, 2024
1 parent ed56f24 commit 83800bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/lib/components/Sharing/SharingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { DashboardCollaboration } from 'scenes/dashboard/DashboardCollaborators'
import { InsightModel, InsightShortId, InsightType } from '~/types'

import { sharingLogic } from './sharingLogic'
import {captureException} from "@sentry/react";

export const SHARING_MODAL_WIDTH = 600

Expand Down Expand Up @@ -114,7 +115,14 @@ export function SharingModalContent({
<LemonButton
data-attr="sharing-link-button"
size="small"
onClick={() => void copyToClipboard(shareLink, 'link')}
onClick={() => {
// TRICKY: there's a chance this was sending useless errors to Sentry
// even when it succeeded, so we're explicitly ignoring the promise success
// and naming the error when reported to Sentry
copyToClipboard(shareLink, 'link')
.then(() => {}) // purposefully no-op
.catch((e) => captureException(new Error('unexpected sharing modal clipboard error: ' + e.message)));
}}
icon={<IconLink />}
>
Copy public link
Expand Down

0 comments on commit 83800bd

Please sign in to comment.