Skip to content

Misleading warning for progress callback exceptions #776

Open
@lorenzocesconetto

Description

@lorenzocesconetto

Describe the bug
Currently a misleading warning is logged when a progress callback raises an exception.
It states that it "Failed to validate notification".
I've already issued a PR to fix it: #775

To Reproduce

async def progress_cb(progress: float, total: float | None, message: str | None):
    raise RuntimeError("Cannot divide by zero.")

result = await self.session.call_tool(
                    tool_name,
                    arguments,
                    progress_callback=progress_cb,
                )

Expected behavior
Indicate to the developer that his callback threw an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions