Skip to content

Commit

Permalink
Fix schema not found error on vendor specific data (#26120)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt authored and pull[bot] committed Oct 24, 2023
1 parent bffdfd1 commit 802271f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/controller/python/chip/clusters/Attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(self, ClusterType: Cluster = None, AttributeType: ClusterAttributeD
break

if (self.ClusterType is None or self.AttributeType is None):
raise Exception("Schema not found")
raise KeyError(f"No Schema found for Attribute {Path}")

# Next, let's figure out the label.
for field in self.ClusterType.descriptor.Fields:
Expand All @@ -156,7 +156,7 @@ def __init__(self, ClusterType: Cluster = None, AttributeType: ClusterAttributeD
self.AttributeName = field.Label

if (self.AttributeName is None):
raise Exception("Schema not found")
raise KeyError(f"Unable to resolve name for Attribute {Path}")

self.Path = Path
self.ClusterId = self.ClusterType.id
Expand Down Expand Up @@ -745,8 +745,14 @@ def _handleReportEnd(self):

if (self._subscription_handler is not None):
for change in self._changedPathSet:
try:
attribute_path = TypedAttributePath(Path=change)
except (KeyError, ValueError) as err:
# path could not be resolved into a TypedAttributePath
logging.getLogger(__name__).exception(err)
continue
self._subscription_handler.OnAttributeChangeCb(
TypedAttributePath(Path=change), self._subscription_handler)
attribute_path, self._subscription_handler)

# Clear it out once we've notified of all changes in this transaction.
self._changedPathSet = set()
Expand Down

0 comments on commit 802271f

Please sign in to comment.