Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow ID on not-found activity error message #428

Merged
merged 6 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading