Merge pull request #6608 from Rob--W/improved-error-message-local-file

Improve error message for non-existent local files
This commit is contained in:
Yury Delendik 2015-11-09 15:40:41 -06:00
commit 3c6df26704
2 changed files with 4 additions and 2 deletions

View File

@ -245,11 +245,13 @@ var NetworkManager = (function NetworkManagerClosure() {
});
} else if (pendingRequest.onProgressiveData) {
pendingRequest.onDone(null);
} else {
} else if (chunk) {
pendingRequest.onDone({
begin: 0,
chunk: chunk
});
} else if (pendingRequest.onError) {
pendingRequest.onError(xhr.status);
}
},

View File

@ -236,7 +236,7 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
onError: function onError(status) {
var exception;
if (status === 404) {
if (status === 404 || status === 0 && /^file:/.test(source.url)) {
exception = new MissingPDFException('Missing PDF "' +
source.url + '".');
handler.send('MissingPDF', exception);