mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
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
2 changed files with 5 additions and 8 deletions
12
web/app.js
12
web/app.js
|
@ -1621,17 +1621,13 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
|
|||
// 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.
|
||||
PDFViewerApplication.setTitleUsingUrl(file);
|
||||
let xhr = new XMLHttpRequest();
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.onload = function() {
|
||||
PDFViewerApplication.open(new Uint8Array(xhr.response));
|
||||
};
|
||||
try {
|
||||
xhr.open('GET', file);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.send();
|
||||
} catch (ex) {
|
||||
throw ex;
|
||||
}
|
||||
xhr.open('GET', file);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.send();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue