mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:33:27 +00:00
Merge pull request #2762 from overleaf/as-prevent-missing-pdf-exception
Prevent Sentry from reporting "expected" MissingPDFException GitOrigin-RevId: 4a6da75bcb3710df7b3be71005d57160e609b0d4
This commit is contained in:
parent
27941dc8af
commit
bf952e134f
1 changed files with 11 additions and 14 deletions
|
@ -79,9 +79,17 @@ define([
|
|||
return $scope.$emit('loaded')
|
||||
},
|
||||
errorCallback(error) {
|
||||
__guardMethod__(window.Raven, 'captureMessage', o =>
|
||||
o.captureMessage(`pdfng error ${error}`)
|
||||
)
|
||||
if (window.Raven) {
|
||||
// MissingPDFException is "expected" as the pdf file can be on a
|
||||
// CLSI server that has been cycled out.
|
||||
// Currently, there is NO error handling to handle this situation,
|
||||
// but we plan to add this in the future
|
||||
// (https://github.com/overleaf/issues/issues/2985) and this error
|
||||
// is causing noise in Sentry so ignore it
|
||||
if (!error.name === 'MissingPDFException') {
|
||||
window.Raven.captureMessage(`pdfng error ${error}`)
|
||||
}
|
||||
}
|
||||
return $scope.$emit('pdf:error', error)
|
||||
},
|
||||
pageSizeChangeCallback(pageNum, deltaH) {
|
||||
|
@ -850,17 +858,6 @@ define([
|
|||
}))
|
||||
})
|
||||
|
||||
function __guardMethod__(obj, methodName, transform) {
|
||||
if (
|
||||
typeof obj !== 'undefined' &&
|
||||
obj !== null &&
|
||||
typeof obj[methodName] === 'function'
|
||||
) {
|
||||
return transform(obj, methodName)
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
function __range__(left, right, inclusive) {
|
||||
let range = []
|
||||
let ascending = left < right
|
||||
|
|
Loading…
Reference in a new issue