[sdk_v2] improves error handling in js sdk #435
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JavaScript SDK Improvements
🚀 Error Handling
Error Context Enhancement
causeproperty for full error chaining🛠️ Usability & Validation
Strict Input Validation
validateMessagestoChatClient:roleandcontentare non-empty stringsvalidateAudioFilePathtoAudioClient:getModelandgetModelVariantnow throw descriptive errors if the item is not found✅ Test Coverage
Expanded Validation Tests
catalog.getModel(null/undefined)catalog.getModelVariant(null/undefined)client.completeChat(null/undefined)client.completeStreamingChat(null/undefined, callback)callbackfunctions are valid (not null/undefined/non-function)📚 Documentation
docs/interfaces/*.mdto reflect type definition changes intypes.ts