Files
bsky-social-app/src/logger/reporting/sendErrorReport.ts
T
2026-05-05 17:21:42 -05:00

31 lines
715 B
TypeScript

import slugify from 'slugify'
import {getEntries} from '#/logger/logDump'
import {Sentry} from '#/logger/sentry/lib'
export function sendErrorReport({
title,
description,
handle,
}: {
title: string
description: string
handle: string
}) {
const name = slugify(title, {lower: true, strict: true}).slice(0, 32)
Sentry.withScope(scope => {
scope.addAttachment({
filename: name + '.json',
data: JSON.stringify(getEntries()),
contentType: 'application/json',
// mimetype: 'application/json', // need to update Sentry
})
scope.setExtras({
title,
description,
handle,
})
scope.captureMessage(`[USER REPORT] ${handle} ${name}`, 'error')
})
}