Skip to content

Commit

Permalink
页面渲染中断错误处理
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinlic committed Nov 23, 2023
1 parent 38ed0f1 commit 4ef2999
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ export default class Page extends EventEmitter {
* @param {Error} err - 错误对象
*/
#emitError(err) {
if(err.message.indexOf("Another frame is pending") != -1)
err = new Error("Page rendering has been interrupted");
if (this.eventNames().indexOf("error") != -1)
this.emit("error", err);
else
Expand Down
2 changes: 1 addition & 1 deletion core/Synthesizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export default class Synthesizer extends EventEmitter {
if (value > 100)
value = 100;
this.progress = Math.floor(value * 1000) / 1000;
if (this.showProgress) {
if (this._cliProgress) {
if (!this._cliProgress.started) {
if (this._cliProgress instanceof cliProgress.MultiBar)
this._cliProgress = this._cliProgress.create(this._targetFrameCount, 0);
Expand Down

0 comments on commit 4ef2999

Please sign in to comment.