File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class Chart extends LitElement {
3333 @state ( ) private highlightedEntities : EntityConfigInternal [ ] = [ ] ;
3434 @state ( ) private lastUpdate = 0 ;
3535 @state ( ) public zoomEntity ?: EntityConfigInternal ;
36+ @state ( ) public error ?: Error ;
3637
3738 // https://lit.dev/docs/components/lifecycle/#reactive-update-cycle-performing
3839 protected shouldUpdate ( changedProps : PropertyValues ) : boolean {
@@ -86,7 +87,8 @@ export class Chart extends LitElement {
8687 ent . children . forEach ( childId => {
8788 const child = this . config . sections [ sectionIndex + 1 ] ?. entities . find ( e => e . entity_id === childId ) ;
8889 if ( ! child ) {
89- throw new Error ( localize ( 'common.missing_child' ) + ' ' + childId ) ;
90+ this . error = new Error ( localize ( 'common.missing_child' ) + ' ' + childId ) ;
91+ throw this . error ;
9092 }
9193 const connection : ConnectionState = {
9294 parent : ent ,
@@ -447,6 +449,9 @@ export class Chart extends LitElement {
447449 // https://lit.dev/docs/components/rendering/
448450 protected render ( ) : TemplateResult | void {
449451 try {
452+ if ( this . error ) {
453+ throw this . error ;
454+ }
450455 this . entityStates . clear ( ) ;
451456 const containerClasses = classMap ( {
452457 container : true ,
You can’t perform that action at this time.
0 commit comments