mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Report filtered pdf.js errors to Sentry (#5438)
GitOrigin-RevId: 7ab5a6fd61d271037ee33bbeadfad00b389812d6
This commit is contained in:
parent
4c25dcfb2b
commit
7f5200da8c
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,7 @@ import * as PDFJSViewer from 'pdfjs-dist/legacy/web/pdf_viewer'
|
|||
import PDFJSWorker from 'pdfjs-dist/legacy/build/pdf.worker'
|
||||
import 'pdfjs-dist/legacy/web/pdf_viewer.css'
|
||||
import getMeta from '../../../utils/meta'
|
||||
import { captureMessage } from '../../../infrastructure/error-reporter'
|
||||
|
||||
if (typeof window !== 'undefined' && 'Worker' in window) {
|
||||
PDFJS.GlobalWorkerOptions.workerPort = new PDFJSWorker()
|
||||
|
@ -89,6 +90,10 @@ export default class PDFJSWrapper {
|
|||
})
|
||||
.catch(error => {
|
||||
if (this.loadDocumentTask) {
|
||||
if (error.name !== 'MissingPDFException') {
|
||||
captureMessage(`pdf preview error ${error}`)
|
||||
}
|
||||
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue