mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Dispatch a "documenterror" event in PDFViewerApplication._documentError
(issue 14451)
*Please note:* This is a tentative patch, since I don't know if this is deemed important enough to fix. The new event could be seen as a *supplement* to the existing "documentinit" and "documentloaded" events, but for the case when a PDF document fails to load. To make the "documenterror" event generally useful, it'll include both the localized error message as well as the original reason for the error (when that exists).
This commit is contained in:
parent
e0032811cd
commit
bf8a58e5e3
1 changed files with 6 additions and 0 deletions
|
@ -1057,6 +1057,12 @@ const PDFViewerApplication = {
|
|||
this._unblockDocumentLoadEvent();
|
||||
|
||||
this._otherError(message, moreInfo);
|
||||
|
||||
this.eventBus.dispatch("documenterror", {
|
||||
source: this,
|
||||
message,
|
||||
reason: moreInfo?.message ?? null,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue