forked from mystiq/hydrogen-web
catch errors thrown by childview mount method on add in ListView
This commit is contained in:
parent
05cc1f6757
commit
ff370d03db
1 changed files with 7 additions and 1 deletions
|
@ -122,7 +122,13 @@ export class ListView {
|
|||
this.onBeforeListChanged();
|
||||
const child = this._childCreator(value);
|
||||
this._childInstances.splice(idx, 0, child);
|
||||
insertAt(this._root, idx, child.mount(this._mountArgs));
|
||||
let node;
|
||||
try {
|
||||
node = child.mount(this._mountArgs);
|
||||
} catch (err) {
|
||||
node = errorToDOM(err);
|
||||
}
|
||||
insertAt(this._root, idx, node);
|
||||
this.onListChanged();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue