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:
commit
3c6df26704
@ -245,11 +245,13 @@ var NetworkManager = (function NetworkManagerClosure() {
|
|||||||
});
|
});
|
||||||
} else if (pendingRequest.onProgressiveData) {
|
} else if (pendingRequest.onProgressiveData) {
|
||||||
pendingRequest.onDone(null);
|
pendingRequest.onDone(null);
|
||||||
} else {
|
} else if (chunk) {
|
||||||
pendingRequest.onDone({
|
pendingRequest.onDone({
|
||||||
begin: 0,
|
begin: 0,
|
||||||
chunk: chunk
|
chunk: chunk
|
||||||
});
|
});
|
||||||
|
} else if (pendingRequest.onError) {
|
||||||
|
pendingRequest.onError(xhr.status);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
|
|||||||
|
|
||||||
onError: function onError(status) {
|
onError: function onError(status) {
|
||||||
var exception;
|
var exception;
|
||||||
if (status === 404) {
|
if (status === 404 || status === 0 && /^file:/.test(source.url)) {
|
||||||
exception = new MissingPDFException('Missing PDF "' +
|
exception = new MissingPDFException('Missing PDF "' +
|
||||||
source.url + '".');
|
source.url + '".');
|
||||||
handler.send('MissingPDF', exception);
|
handler.send('MissingPDF', exception);
|
||||||
|
Loading…
Reference in New Issue
Block a user