From 31916f3015c28477701d5f8a4f8e17a6601215df Mon Sep 17 00:00:00 2001 From: mwfarb Date: Wed, 21 Feb 2024 15:19:31 -0500 Subject: [PATCH] fix: telemetry check for type failing in delete --- arena/scene.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arena/scene.py b/arena/scene.py index 5a692e7e..98b3daf8 100644 --- a/arena/scene.py +++ b/arena/scene.py @@ -488,7 +488,10 @@ async def _delayed_task(): def _publish(self, obj, action, custom_payload=False): """Publishes to mqtt broker with "action":action""" - with self.telemetry.start_publish_span(obj["object_id"], action, obj["type"]) as span: + obj_type = None + if "type" in obj: + obj_type = obj["type"] + with self.telemetry.start_publish_span(obj["object_id"], action, obj_type) as span: if not self.can_publish: self.telemetry.set_error(f"ERROR: Publish failed! You do not have permission to publish to topic {self.root_topic} on {self.web_host}", span)