Merge pull request #9266 from overleaf/ae-pdf-preview-sentry

Use captureException for recording errors in pdf preview

GitOrigin-RevId: ab3cf0a9d5579ea78c09ad10ec1b7e209d408519
This commit is contained in:
Alf Eaton 2022-08-18 09:17:12 +01:00 committed by Copybot
parent 9c567fc106
commit 4250c4030f

View file

@ -1,4 +1,4 @@
import { captureMessage } from '../../../infrastructure/error-reporter'
import { captureException } from '../../../infrastructure/error-reporter'
import { generatePdfCachingTransportFactory } from './pdf-caching-transport'
const params = new URLSearchParams(window.location.search)
@ -117,7 +117,9 @@ export default class PDFJSWrapper {
.catch(error => {
if (this.loadDocumentTask) {
if (!error || error.name !== 'MissingPDFException') {
captureMessage(`pdf preview error ${error}`)
captureException(error, {
tags: { handler: 'pdf-preview' },
})
}
reject(error)