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

fix for #2219, "provide a better error message when file= not found/accessible"

summary: create a new Exception class for missing PDF's, use it in place of generic

add new MissingPDFException to util.js
handle MissingPDF in api.js
handle MissingPDF in viewer.js, using new missing_file_error message
add new missing_file_error to l10n/en-US/viewer.properties
send MissingPDF from WorkerMessageHandler's loadDocument
send MissingPDF from GetDocRequest handler
This commit is contained in:
Bill Walker 2013-01-29 10:13:28 -08:00
parent 7bd8887860
commit 12af2f9431
5 changed files with 43 additions and 2 deletions

View file

@ -1000,6 +1000,17 @@ var PDFView = {
//#endif
}
if (exception && exception.name === 'MissingPDFException') {
// special message for missing PDF's
var loadingErrorMessage = mozL10n.get('missing_file_error', null,
'Missing 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');