Skip to content

Commit

Permalink
Add workflow ID on not-found activity error message (#428)
Browse files Browse the repository at this point in the history
Fixes #416
  • Loading branch information
cretz authored Feb 20, 2024
1 parent b0a7b4e commit 1cfdaa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion temporalio/worker/_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ async def _run_activity(
if not activity_def:
activity_names = ", ".join(sorted(self._activities.keys()))
raise temporalio.exceptions.ApplicationError(
f"Activity function {start.activity_type} is not registered on this worker, available activities: {activity_names}",
f"Activity function {start.activity_type} for workflow {start.workflow_execution.workflow_id} "
f"is not registered on this worker, available activities: {activity_names}",
type="NotFoundError",
)

Expand Down
5 changes: 1 addition & 4 deletions tests/worker/test_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,7 @@ async def say_hello(name: str) -> str:
id=str(uuid.uuid4()),
task_queue=worker.task_queue,
)
assert str(assert_activity_application_error(err.value)) == (
"NotFoundError: Activity function wrong_activity is not registered on this worker, "
"available activities: say_hello"
)
assert "is not registered" in str(assert_activity_application_error(err.value))


async def test_max_concurrent_activities(client: Client, worker: ExternalWorker):
Expand Down

0 comments on commit 1cfdaa8

Please sign in to comment.