Skip to content

Commit 1cfdaa8

Browse files
authored
Add workflow ID on not-found activity error message (#428)
Fixes #416
1 parent b0a7b4e commit 1cfdaa8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

temporalio/worker/_activity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ async def _run_activity(
286286
if not activity_def:
287287
activity_names = ", ".join(sorted(self._activities.keys()))
288288
raise temporalio.exceptions.ApplicationError(
289-
f"Activity function {start.activity_type} is not registered on this worker, available activities: {activity_names}",
289+
f"Activity function {start.activity_type} for workflow {start.workflow_execution.workflow_id} "
290+
f"is not registered on this worker, available activities: {activity_names}",
290291
type="NotFoundError",
291292
)
292293

tests/worker/test_activity.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,7 @@ async def say_hello(name: str) -> str:
544544
id=str(uuid.uuid4()),
545545
task_queue=worker.task_queue,
546546
)
547-
assert str(assert_activity_application_error(err.value)) == (
548-
"NotFoundError: Activity function wrong_activity is not registered on this worker, "
549-
"available activities: say_hello"
550-
)
547+
assert "is not registered" in str(assert_activity_application_error(err.value))
551548

552549

553550
async def test_max_concurrent_activities(client: Client, worker: ExternalWorker):

0 commit comments

Comments
 (0)