1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

* InvalidPDFException added

* Act on throwing an Exception and InvalidPDFException by rejecting the worker
instead of throwing
* changed message for all builds
* alerting and closing window only for B2G builds
* invalid_file_error added to l10n (en and pl)
* UnknownErrorException added and used for every error()
This commit is contained in:
Piotr Zalewa 2012-10-16 12:10:37 +02:00
parent 336d5041dd
commit 812bc6795d
7 changed files with 62 additions and 5 deletions

View file

@ -895,14 +895,26 @@ var PDFView = {
}
}
var loadingErrorMessage = mozL10n.get('loading_error', null,
'An error occurred while loading the PDF.');
if (exception && exception.name === 'InvalidPDFException') {
// change error message also for other builds
var loadingErrorMessage = mozL10n.get('invalid_file_error', null,
'Invalid or corrupted PDF file.');
//#if B2G
// window.alert(loadingErrorMessage);
// return window.close();
//#endif
}
var loadingIndicator = document.getElementById('loading');
loadingIndicator.textContent = mozL10n.get('loading_error_indicator',
null, 'Error');
var moreInfo = {
message: message
};
self.error(mozL10n.get('loading_error', null,
'An error occurred while loading the PDF.'), moreInfo);
self.error(loadingErrorMessage, moreInfo);
self.loading = false;
},
function getDocumentProgress(progressData) {