Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

docs(hooks): document exception property on AfterToolCallEvent - #482

Merged
zastrowm merged 1 commit into
strands-agents:mainfrom
charles-dyfis-net:pysdk-issue-1565
Mar 20, 2026
Merged

zastrowm merged 1 commit into
strands-agents:mainfrom
charles-dyfis-net:pysdk-issue-1565

Conversation

@charles-dyfis-net

Copy link
Copy Markdown
Contributor

Description

Documents the exception property on AfterToolCallEvent, which provides access to the original exception when a tool raises an error. This enables hooks to distinguish between expected errors (which the model should retry) and unexpected errors (which should fail immediately).

Changes:

  • Added exception to the AfterToolCallEvent properties list in the Event Properties section
  • Added new "Exception Handling" subsection in Advanced Usage with a PropagateUnexpectedExceptions example hook

Related Issues

strands-agents/harness-sdk#1565

Type of Change

  • Content update/revision

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using mkdocs serve
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview Ready

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-482/docs/user-guide/quickstart/overview/

Updated at: 2026-03-20T13:58:45.351Z

Comment thread src/content/docs/user-guide/concepts/agents/hooks.mdx
@github-actions

Copy link
Copy Markdown
Contributor

Assessment: Comment

Good documentation addition that clearly explains the exception property on AfterToolCallEvent and provides a practical example of selectively propagating unexpected exceptions.

Review Details
  • Code Example: One minor issue - the Python example is missing the import statement that other HookProvider examples include
  • Pattern Consistency: TypeScript placeholder and documentation structure follow established patterns

Thanks for adding this documentation! The exception handling use case is valuable for users implementing robust error handling in their agents.

@zastrowm
zastrowm enabled auto-merge (squash) March 20, 2026 21:24
@zastrowm
zastrowm merged commit 58d1cd5 into strands-agents:main Mar 20, 2026
5 checks passed
notowen333 pushed a commit to notowen333/docs that referenced this pull request Mar 27, 2026
…ds-agents#482)

Co-authored-by: Charles Duffy <charles-dyfis-net@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
manual-approval — 70d2b8a7 Deployed Mar 20, 2026 by ryanycoleman via Trigger Strands Review #302
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants