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) {
|
||||
pendingRequest.onDone(null);
|
||||
} else {
|
||||
} else if (chunk) {
|
||||
pendingRequest.onDone({
|
||||
begin: 0,
|
||||
chunk: chunk
|
||||
});
|
||||
} else if (pendingRequest.onError) {
|
||||
pendingRequest.onError(xhr.status);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user