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
Document the new onSqlError hook that allows users to customize SQL error
logging behavior. This hook provides:
- Ability to override the default console.error logging
- Access to both the failed query and error details
- Use cases for integrating with monitoring services
Related PR: cloudflare/agents#768
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
console.error(`SQL error for query: ${query}`, error);
637
+
}
638
+
639
+
async getUserData(userId:string) {
640
+
// If this query fails, onSqlError will be called automatically
641
+
const users =this.sql`
642
+
SELECT * FROM users WHERE id = ${userId}
643
+
`;
644
+
returnusers[0];
645
+
}
646
+
}
647
+
```
648
+
649
+
</TypeScriptExample>
650
+
599
651
### MCP Client API
600
652
601
653
The Agents SDK allows your Agent to act as an MCP (Model Context Protocol) client, connecting to remote MCP servers and using their tools, resources, and prompts.
0 commit comments