Enable the no-useless-catch
ESLint rule
See https://eslint.org/docs/rules/no-useless-catch
This commit is contained in:
parent
1f3e7700d2
commit
86472e9981
@ -88,6 +88,7 @@
|
|||||||
"no-unused-expressions": "error",
|
"no-unused-expressions": "error",
|
||||||
"no-unused-labels": "error",
|
"no-unused-labels": "error",
|
||||||
"no-useless-call": "error",
|
"no-useless-call": "error",
|
||||||
|
"no-useless-catch": "error",
|
||||||
"no-useless-concat": "error",
|
"no-useless-concat": "error",
|
||||||
"prefer-promise-reject-errors": "error",
|
"prefer-promise-reject-errors": "error",
|
||||||
"wrap-iife": ["error", "any"],
|
"wrap-iife": ["error", "any"],
|
||||||
|
@ -1621,17 +1621,13 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
|
|||||||
// cannot load file:-URLs in a Web Worker. file:-URLs are usually loaded
|
// cannot load file:-URLs in a Web Worker. file:-URLs are usually loaded
|
||||||
// very quickly, so there is no need to set up progress event listeners.
|
// very quickly, so there is no need to set up progress event listeners.
|
||||||
PDFViewerApplication.setTitleUsingUrl(file);
|
PDFViewerApplication.setTitleUsingUrl(file);
|
||||||
let xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
PDFViewerApplication.open(new Uint8Array(xhr.response));
|
PDFViewerApplication.open(new Uint8Array(xhr.response));
|
||||||
};
|
};
|
||||||
try {
|
|
||||||
xhr.open('GET', file);
|
xhr.open('GET', file);
|
||||||
xhr.responseType = 'arraybuffer';
|
xhr.responseType = 'arraybuffer';
|
||||||
xhr.send();
|
xhr.send();
|
||||||
} catch (ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user