fix: properly handle non ticking promises and errors
This commit is contained in:
parent
3503f0fd01
commit
de88478016
|
@ -36,12 +36,13 @@ export class Actions extends decorate(Traversals) {
|
|||
this.emitFinished();
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this.pending
|
||||
&& this.pending instanceof TickingPromise
|
||||
&& 'function' === typeof this.pending.ticker
|
||||
) {
|
||||
this.pending.ticker(elapsed);
|
||||
if (this.pending) {
|
||||
if (
|
||||
this.pending instanceof TickingPromise
|
||||
&& 'function' === typeof this.pending.ticker
|
||||
) {
|
||||
this.pending.ticker(elapsed);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -50,9 +51,12 @@ export class Actions extends decorate(Traversals) {
|
|||
while (true) {
|
||||
const result = this.traversals[this.index].traverse(context);
|
||||
if (result instanceof Promise) {
|
||||
result.then(() => this.prologue());
|
||||
result.then(() => {
|
||||
this.prologue();
|
||||
});
|
||||
result.catch((error) => {
|
||||
throw error;
|
||||
console.error(error);
|
||||
this.prologue();
|
||||
});
|
||||
this.pending = result;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user