Skip to content

Commit e5fbd4f

Browse files
Update error message for changed event on property
1 parent 919db28 commit e5fbd4f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/labthings_fastapi/descriptors/property.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ def emit_changed_event(self, obj: Thing, value: Any) -> None:
132132
"""
133133
runner = obj._labthings_blocking_portal
134134
if not runner:
135-
raise NotConnectedToServerError("Can't emit without a blocking portal")
135+
thing_name = obj.__class__.__name__
136+
msg = (
137+
f"Cannot emit property updated changed event. Is {thing_name} "
138+
"connected to a running server?"
139+
)
140+
raise NotConnectedToServerError(msg)
136141
runner.start_task_soon(
137142
self.emit_changed_event_async,
138143
obj,

0 commit comments

Comments
 (0)