Skip to content

feat: robust error handling and type safety#249

Open
linked-danis wants to merge 1 commit intoalibaba:mainfrom
linked-danis:pr3-error-handling
Open

feat: robust error handling and type safety#249
linked-danis wants to merge 1 commit intoalibaba:mainfrom
linked-danis:pr3-error-handling

Conversation

@linked-danis
Copy link
Contributor

Add type-safe error helpers and remove 'as any' casts.

Changes:

  • Add isAbortError() helper for checking abort signals
  • Add getEventDetail() helper for CustomEvent extraction
  • Fix variable naming in isRetryable() (isAborted vs isAbortError)
  • Use proper instanceof checks instead of casting
  • Add proper interface for normalized response data
  • Type-safe tool execution error messages

What

Brief description of changes.

Type

  • Bug fix
  • Feature / Improvement
  • Refactor
  • Documentation
  • Website
  • Demo / Testing
  • Breaking change

Testing

  • Tested in modern browsers
  • No console errors
  • Types/doc added

Closes #(issue)

Requirements / 要求

  • I have read and follow the Code of Conduct and Contributing Guide . / 我已阅读并遵守行为准则。
  • This PR is NOT generated by a bot or AI agent acting autonomously. I have authored or meaningfully reviewed every change. / 此 PR 不是由 bot 或 AI 自主生成的,我已亲自编写或充分审查了每一处变更。

Add type-safe error helpers and remove 'as any' casts.

Changes:
- Add isAbortError() helper for checking abort signals
- Add getEventDetail() helper for CustomEvent extraction
- Fix variable naming in isRetryable() (isAborted vs isAbortError)
- Use proper instanceof checks instead of casting
- Add proper interface for normalized response data
- Type-safe tool execution error messages
@linked-danis
Copy link
Contributor Author

second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant