Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, function (exception) {
let message = exception && exception.message
let l10n = self.l10n
let loadingErrorMessage
if (exception instanceof pdfjsLib.InvalidPDFException) {
// change error message also for other builds
loadingErrorMessage = l10n.get('invalid_file_error', null,
'Invalid or corrupted PDF file.')
} else if (exception instanceof pdfjsLib.MissingPDFException) {
// special message for missing PDFs
loadingErrorMessage = l10n.get('missing_file_error', null,
'Missing PDF file.')
} else if (exception instanceof pdfjsLib.UnexpectedResponseException) {
loadingErrorMessage = l10n.get('unexpected_response_error', null,
'Unexpected server response.')
} else {
loadingErrorMessage = l10n.get('loading_error', null,
'An error occurred while loading the PDF.')
}
loadingErrorMessage.then(function (msg) {
}, function (exception) {
let message = exception && exception.message
let l10n = self.l10n
let loadingErrorMessage
if (exception instanceof pdfjsLib.InvalidPDFException) {
// change error message also for other builds
loadingErrorMessage = l10n.get('invalid_file_error', null,
'Invalid or corrupted PDF file.')
} else if (exception instanceof pdfjsLib.MissingPDFException) {
// special message for missing PDFs
loadingErrorMessage = l10n.get('missing_file_error', null,
'Missing PDF file.')
} else if (exception instanceof pdfjsLib.UnexpectedResponseException) {
loadingErrorMessage = l10n.get('unexpected_response_error', null,
'Unexpected server response.')
} else {
loadingErrorMessage = l10n.get('loading_error', null,
'An error occurred while loading the PDF.')
}
loadingErrorMessage.then(function (msg) {