Parcourir la source

mol-state: log error in transaction

David Sehnal il y a 5 ans
Parent
commit
f01fc7c8ba
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5 2
      src/mol-state/state.ts

+ 5 - 2
src/mol-state/state.ts

@@ -138,10 +138,13 @@ class State {
                 this.cells.forEach(c => hasError = hasError || c.state === 'error');
                 if (hasError) {
                     restored = true;
-                    this.updateTree(snapshot).runInContext(ctx);
+                    await this.updateTree(snapshot).runInContext(ctx);
                 }
             } catch (e) {
-                if (!restored) this.updateTree(snapshot).runInContext(ctx);
+                if (!restored) {
+                    await this.updateTree(snapshot).runInContext(ctx);
+                    this.events.log.error(e);
+                }
             }
         });
     }