Skip to content

Conversation

@agents-git-bot
Copy link
Contributor

@agents-git-bot agents-git-bot bot commented Jan 6, 2026

Summary

  • Document the new SqlError class for SQL error handling
  • Update onError documentation to show how to handle SQL errors specifically
  • Add cross-references between SQL API and error handling documentation

Changes

This documentation sync corresponds to cloudflare/agents#768, which introduces a new SqlError class that wraps SQL query failures. The SqlError class provides:

  • A query property that contains the failed SQL query
  • Integration with the existing onError method for unified error handling
  • The ability to distinguish SQL errors from other error types

Users can now catch SQL errors in their onError handler and inspect which query failed, improving debugging and error handling capabilities.

Documentation updates

  • agents-api.mdx: Added SQL error handling section with SqlError class reference and usage example
  • agent-class.mdx: Updated onError section to include SQL error handling example
  • store-and-sync-state.mdx: Added note about automatic SQL error wrapping with link to detailed documentation

Related PR

🤖 Generated with Claude Code

@github-actions github-actions bot added the product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. label Jan 6, 2026
@github-actions github-actions bot added the size/s label Jan 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents

@agents-git-bot agents-git-bot bot changed the title Add documentation for onSqlError hook Sync docs: add onSqlError hook for customizable SQL error logging Jan 6, 2026
@agents-git-bot agents-git-bot bot changed the title Sync docs: add onSqlError hook for customizable SQL error logging add onSqlError hook for customizable SQL error logging Jan 6, 2026
@agents-git-bot agents-git-bot bot force-pushed the sync-docs-pr-768 branch 2 times, most recently from bc7bd66 to 21b10cc Compare January 6, 2026 14:58
Add documentation for the new SqlError class that is thrown when SQL
queries fail in Agents. This helps developers understand how to handle
SQL-specific errors through the onError method.

Related to cloudflare/agents#768

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@agents-git-bot agents-git-bot bot changed the title add onSqlError hook for customizable SQL error logging Add SqlError class documentation for SQL error handling Jan 6, 2026
Document the new SqlError class that wraps SQL query failures.
Users can now distinguish SQL errors in their onError handler
and access the failed query via the query property.

Synced from cloudflare/agents PR #768

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@agents-git-bot agents-git-bot bot changed the title Add SqlError class documentation for SQL error handling pipe SQL errors into the existing onError method using a new SqlError class Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants