-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] JS admin client should throw well-formatted errors rather than Responses #2106
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
6e099b1
to
4be42b7
Compare
@@ -64,7 +65,7 @@ export class AdminClient { | |||
basePath: path, | |||
}); | |||
|
|||
this.api = new DefaultApi(apiConfig); | |||
this.api = new DefaultApi(apiConfig, undefined, chromaFetch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my understanding, why does this result in well formatted errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chromaFetch
is a wrapper around fetch()
that will throw Errors based on the response status code
by default, the autogenerated client seems to throw Responses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
Previously, the admin client was throwing
Response
s rather than Errors. It now uses the same helper as the data plane client to throw well-formatted errors.