Enable the no-useless-catch ESLint rule

See https://eslint.org/docs/rules/no-useless-catch
This commit is contained in:
Jonas Jenwald 2019-01-28 11:00:09 +01:00
parent 1f3e7700d2
commit 86472e9981
2 changed files with 5 additions and 8 deletions

View File

@ -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"],

View File

@ -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;
} }