You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sent a message to an agent before the runtime had actually been created. Caught an Exception object from this line as neither my agent or the runtime had been properly set up.
What I was expecting
A more specific Exception object that I could target to handle this case. I currently need to check for this specific error string to avoid catching every Exception that might by raised by the runtime.
The text was updated successfully, but these errors were encountered:
Wow this a terrible write-up. I'm sorry, I tried to create the issue from the offending source line and thought a link would be included here, making the exception in question obvious.
Steps to reproduce
Copy the modifier/checker example in the quickstart
Comment one of the agent registration calls like this:
# Create an local embedded runtime.
runtime = SingleThreadedAgentRuntime()
# Register the modifier and checker agents by providing
# their agent types, the factory functions for creating instance and subscriptions.
await Modifier.register(
runtime,
"modifier",
# Modify the value by subtracting 1
lambda: Modifier(modify_val=lambda x: x - 1),
)
# await Checker.register(
# runtime,
# "checker",
# # Run until the value is less than or equal to 1
# lambda: Checker(run_until=lambda x: x <= 1),
# )
# Start the runtime and send a direct message to the checker.
runtime.start()
await runtime.send_message(Message(10), AgentId("checker", "default"))
await runtime.stop_when_idle()
Receive a vanilla Exception with description "Recipient not found"
What I did
Sent a message to an agent before the runtime had actually been created. Caught an Exception object from this line as neither my agent or the runtime had been properly set up.
What I was expecting
A more specific Exception object that I could target to handle this case. I currently need to check for this specific error string to avoid catching every Exception that might by raised by the runtime.
The text was updated successfully, but these errors were encountered: