Reset #renderError on RenderingCancelledException (PR 19128 follow-up)
This restores the behaviour that existed prior to PR 19128, see e.g. 8727a04ae5/web/pdf_page_view.js (L908-L911), since `RenderingCancelledException` should still overwrite any previously seen Error.
This commit is contained in:
parent
aa70b28365
commit
d50d3b0b0e
@ -169,16 +169,18 @@ class BasePDFPageView {
|
||||
await renderTask.promise;
|
||||
this.#showCanvas?.(true);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
// When zooming with a `drawingDelay` set, avoid temporarily showing
|
||||
// a black canvas if rendering was cancelled before the `onContinue`-
|
||||
// callback had been invoked at least once.
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
if (e instanceof RenderingCancelledException) {
|
||||
return;
|
||||
}
|
||||
error = e;
|
||||
|
||||
this.#showCanvas?.(true);
|
||||
} finally {
|
||||
this.#renderError = error;
|
||||
|
||||
// The renderTask may have been replaced by a new one, so only remove
|
||||
// the reference to the renderTask if it matches the one that is
|
||||
// triggering this callback.
|
||||
@ -186,8 +188,6 @@ class BasePDFPageView {
|
||||
this.renderTask = null;
|
||||
}
|
||||
}
|
||||
this.#renderError = error;
|
||||
|
||||
this.renderingState = RenderingStates.FINISHED;
|
||||
|
||||
onFinish(renderTask);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user